LGTM.com - false positive - c# top-level statements
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 141
Description
**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**
Contributor guide
Assessment
This issue has not been assessed yet.