D-Scanner
D-Scanner copied to clipboard
Swiss-army knife for D source code
```d void main() { struct S { int i; } S s; __traits(getMember, s, "x") = 88; } ``` D-Scanner reports: ``` ./source/app.d(5:7)[warn]: Variable s is never modified and could...
The code: ```d void main() { const Foo foo; bool bl; foo >> bl; } struct Foo { bool bar = true; void opBinary(string op)(out bool value) if (op ==...
While dmd abort compilation, D-Scanner does not find this issue: As this error only occurs while compiling with version CRuntime_Musl, it would be good if D-Scanner can find it. root/.dub/packages/arsd-official-4.4.0/arsd-official/cgi.d(3357,10):...
D-Scanner doesn't seem to understand `extern(C++)` string namespace syntax. --- foo.d --- ```d module foo; extern (C++,"bar") struct Foo{} ``` ``` $ dscanner.exe --syntaxCheck foo.d foo.d(2:13)[error]: ```
Code static analyzers should have a level, category and a description associated to each rule to let wrappers know the severity of the error, more about it and categorize to...
Checking the file https://github.com/adamdruppe/arsd/blob/master/vorbis.d will produce following finding: ``` { "key": "dscanner.confusing.argument_parameter_mismatch", "name": "mismatched_args_check", "fileName": "./gen/tmp/user.home/dub/packages/arsd-official-3.0.1/arsd-official/vorbis.d", "line": 18446744073709551615, "column": 18446744073709551615, "message": "Argument 5 is named 'n', but this is the...
``` dmd/backend/oper.d(497:6)[warn]: This enum may lead to unnecessary allocation at run-time. Use 'static immutable Ebinary = [ ...' instead. ``` The warning is bogus. No allocation occurs, and no code...
The following snippets have an `auto_ref_assignment` warning, even though they shouldn't: ```d string bar; void foo(T)(auto ref string bar) { .bar = bar; // warning here, even though it's assigning...
```d int main() { int a, b; b = a++; return b; } ``` > /tmp/temp_7F93B300A250.d(3:9)[warn]: Variable a is never modified and could have been declared const or immutable.
For source file https://github.com/adamdruppe/arsd/blob/master/ttf.d ```dscanner --report ttf.d``` produces this issue: ```json { "key": "dscanner.confusing.argument_parameter_mismatch", "fileName": "ttf.d", "line": 4294967295, "column": 4294967295, "message": "Argument 6 is named 'x0', but this is the...