github / github/codeql

LGTM.com - false positive - c# top-level statements

Đang mở
#7,916 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
false-positive
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**Description of the false positive**

C# top-level statements are causing an extraction error.

e.g.
```csharp
namespace My.Name.Space;

public class MyClass
{
// ...
}
```

```
Unexpected C# extractor error: Unhandled top-level syntax node
at Semmle.Extraction.CSharp.Populators.TypeContainerVisitor.DefaultVisit(SyntaxNode node) in /home/runner/work/semmle-code/semmle-code/ql/csharp/extractor/Semmle.Extraction.CSharp/Populators/TypeContainerVisitor.cs:line 39
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
at Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax.Accept(CSharpSyntaxVisitor visitor)
at Semmle.Extraction.CSharp.Populators.CompilationUnitVisitor.<>c__DisplayClass2_0.b__0() in /home/runner/work/semmle-code/semmle-code/ql/csharp/extractor/Semmle.Extraction.CSharp/Populators/CompilationUnitVisitor.cs:line 28
at Semmle.Extraction.Context.Try(SyntaxNode node, ISymbol symbol, Action a) in /home/runner/work/semmle-code/semmle-code/ql/csharp/extractor/Semmle.Extraction/Context.cs:line 484
```

**URL to the alert on the project page on LGTM.com**

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.