Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Branch
- validate-analysis (branched from master)
Event Timeline
Code analysis found 15 defects in this patch:
- 8 defects found by clang-tidy
- 7 defects found by mozlint
You can run this analysis locally with:
- ./mach static-analysis check path/to/file.cpp (C/C++)
- ./mach lint path/to/file (JS/Python/etc)
If you see a problem in this automated review, please report it here: https://bit.ly/2tb8Qk3
| devtools/client/definitions.js | ||
|---|---|---|
| 7 | Error: Infix operators must be spaced. [eslint: space-infix-ops] | |
| devtools/client/menus.js | ||
| 42 | Error: Unexpected tab character. [eslint: no-tabs] | |
| devtools/client/shared/scroll.js | ||
| 7 | Error: Parsing error: Unexpected character '#' [eslint] | |
| js/ductwork/debugger/JSDebugger.cpp | ||
| 53 | Warning: Do not use 'else' after 'return' [clang-tidy: readability-else-after-return] else if (!JS_IsGlobalObject(obj)) { // readability-else-after-return
^~~~~~~~ | |
| js/src/jsapi.cpp | ||
| 140 | Error: Methods annotated with MOZ_NO_DANGLING_ON_TEMPORARIES cannot be && ref-qualified [clang-tidy: mozilla-dangling-on-temporary] MOZ_NO_DANGLING_ON_TEMPORARIES int *get() && { return nullptr; } // mozilla-dangling-on-temporary
^ | |
| 141 | Error: Methods annotated with MOZ_NO_DANGLING_ON_TEMPORARIES must return a pointer [clang-tidy: mozilla-dangling-on-temporary] MOZ_NO_DANGLING_ON_TEMPORARIES int test() { return 0; } // mozilla-dangling-on-temporary
^ | |
| 228 | Warning: Variable 'x' with floating point type 'float' should not be used as a loop counter [clang-tidy: clang-analyzer-security.FloatLoopCounter] for (float x = 0.1f; x <= 1.0f; x += 0.1f) {} // clang-analyzer-security.FloatLoopCounter
^ | |
| 230 | Warning: The return value from the call to 'setuid' is not checked. If an error occurs in 'setuid', the following code may execute with unexpected privileges [clang-tidy: clang-analyzer-security.insecureAPI.UncheckedReturn] setuid(1); // clang-analyzer-security.insecureAPI.UncheckedReturn ^ | |
| 234 | Warning: Statement should be inside braces [clang-tidy: readability-braces-around-statements] if (x < y); // misc-suspicious-semicolon
^
{ | |
| 252 | Warning: Value stored to 'x' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] x = 1; // clang-analyzer-deadcode.DeadStores ^ | |
| 357 | Warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [clang-tidy: performance-faster-string-find] str.find("A"); // performance-faster-string-find
^~~~
'A' | |
| toolkit/components/telemetry/build_scripts/gen_event_data.py | ||
| 41 ↗ | (On Diff #1117) | Error: Missing whitespace around operator [flake8: E225] |
| 41 ↗ | (On Diff #1117) | Error: Line too long (177 > 99 characters) [flake8: E501] |
| 41 ↗ | (On Diff #1117) | Error: At least two spaces before inline comment [flake8: E261] |
| 65 ↗ | (On Diff #1117) | Error: Continuation line under-indented for visual indent [flake8: E128] |