github / github/codeql

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

Offen
#7,916 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
false-positive
Vorherrschende Sprache
CodeQL
Sterne
10.1k
Forks
2.1k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
141

Beschreibung

**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**

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.