Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Branch
- HEAD
Event Timeline
Code analysis found 19 defects in this patch:
- 12 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 | ||
| 41 | Error: Unexpected tab character. [eslint: no-tabs] | |
| devtools/client/shared/scroll.js | ||
| 7 | Error: Parsing error: Unexpected character '#' [eslint] | |
| js/ductwork/debugger/JSDebugger.cpp | ||
| 50 | 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 | ||
| 130 | Warning: Suspicious string literal, probably missing a comma [clang-tidy: bugprone-suspicious-missing-comma] "line 6" // misc-suspicious-missing-comma ^ | |
| 142 | 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
^ | |
| 143 | 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
^ | |
| 195 | Warning: Do not use 'else' after 'return' [clang-tidy: readability-else-after-return] else if (ErrorTakesArguments(code_)) { // readability-misleading-indentation or readability-else-after-return
^~~~~~~~ | |
| 227 | 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
^ | |
| 229 | 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 ^ | |
| 233 | Warning: Statement should be inside braces [clang-tidy: readability-braces-around-statements] if (x < y); // misc-suspicious-semicolon
^
{ | |
| 233 | Warning: Potentially unintended semicolon [clang-tidy: bugprone-suspicious-semicolon] if (x < y); // misc-suspicious-semicolon
^ | |
| 251 | Warning: Value stored to 'x' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] x = 1; // clang-analyzer-deadcode.DeadStores ^ | |
| 356 | 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' | |
| 365 | Warning: The type of the loop variable 'p' is different from the one returned by the iterator and generates an implicit conversion; you can either change the type to the matching one ('const std::pair<const int, std::vector<std::cxx11::basic_string<char>, std::allocator<std::cxx11::basic_string<char> > > > &' but 'const auto&' is always a valid option) or remove the reference to make it explicit that you are creating a new value [clang-tidy: performance-implicit-conversion-in-loop] for (const std::pair<int, std::vector<std::string>>& p : my_map) {} // performance-implicit-conversion-in-loop
^ | |
| toolkit/components/telemetry/build_scripts/gen_event_data.py | ||
| 41 | Error: At least two spaces before inline comment [flake8: E261] | |
| 41 | Error: Missing whitespace around operator [flake8: E225] | |
| 41 | Error: Line too long (177 > 99 characters) [flake8: E501] | |
| 65 | Error: Continuation line under-indented for visual indent [flake8: E128] | |
Code analysis found 26 defects in this patch:
- 7 defects found by clang-format
- 12 defects found by clang-tidy
- 7 defects found by mozlint
You can run this analysis locally with:
- ./mach clang-format -p path/to/file.cpp (C/C++)
- ./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
A full diff for the formatting issues found by clang-format is provided here: https://queue.taskcluster.net/v1/task/local instance/runs/0/artifacts/public/results/PHID-DIFF-waci5wxslps37r7vhmvk-clang-format.diff
You can use it in your repository with hg import or git apply
| devtools/client/definitions.js | ||
|---|---|---|
| 7 | Error: Infix operators must be spaced. [eslint: space-infix-ops] | |
| devtools/client/menus.js | ||
| 41 | Error: Unexpected tab character. [eslint: no-tabs] | |
| devtools/client/shared/scroll.js | ||
| 7 | Error: Parsing error: Unexpected character '#' [eslint] | |
| js/ductwork/debugger/JSDebugger.cpp | ||
| 50 | 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 | ||
| 124–132 | Warning: Incorrect coding style [clang-format] const char* Test[] = { "line 1", "line 2", "line 3", "line 4", "line 5", "line 6" // misc-suspicious-missing-comma "line 7", "line 8", | |
| 130 | Warning: Suspicious string literal, probably missing a comma [clang-tidy: bugprone-suspicious-missing-comma] "line 6" // misc-suspicious-missing-comma ^ | |
| 140–143 | Warning: Incorrect coding style [clang-format] class AnnotateConflict MOZ_NO_DANGLING_ON_TEMPORARIES int* get() &&
{
return nullptr;
} // mozilla-dangling-on-temporary
MOZ_NO_DANGLING_ON_TEMPORARIES int test() { return 0; } // mozilla-dangling-on-temporary | |
| 142 | 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
^ | |
| 143 | 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
^ | |
| 190–195 | Warning: Incorrect coding style [clang-format] RootedValue val(cx, ObjectValue(*obj));
return ReportValueErrorFlags(
cx, flags, code_, JSDVG_IGNORE_STACK, val, nullptr, nullptr, nullptr);
}
else if (ErrorTakesArguments(
code_)) { // readability-misleading-indentation or readability-else-after-return | |
| 195 | Warning: Do not use 'else' after 'return' [clang-tidy: readability-else-after-return] else if (ErrorTakesArguments(code_)) { // readability-misleading-indentation or readability-else-after-return
^~~~~~~~ | |
| 226–227 | Warning: Incorrect coding style [clang-format] { for (float x = 0.1f; x <= 1.0f; x += 0.1f) {
} // clang-analyzer-security.FloatLoopCounter | |
| 227 | 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
^ | |
| 229 | 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 ^ | |
| 232–233 | Warning: Incorrect coding style [clang-format] int y = 0;
if (x < y)
; // misc-suspicious-semicolon | |
| 233 | Warning: Potentially unintended semicolon [clang-tidy: bugprone-suspicious-semicolon] if (x < y); // misc-suspicious-semicolon
^ | |
| 233 | Warning: Statement should be inside braces [clang-tidy: readability-braces-around-statements] if (x < y); // misc-suspicious-semicolon
^
{ | |
| 234–235 | Warning: Incorrect coding style [clang-format] {
x++; | |
| 251 | Warning: Value stored to 'x' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores] x = 1; // clang-analyzer-deadcode.DeadStores ^ | |
| 356 | 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' | |
| 364–365 | Warning: Incorrect coding style [clang-format] std::map<int, std::vector<std::string>> my_map;
for (const std::pair<int, std::vector<std::string>>& p : my_map) {
} // performance-implicit-conversion-in-loop | |
| 365 | Warning: The type of the loop variable 'p' is different from the one returned by the iterator and generates an implicit conversion; you can either change the type to the matching one ('const std::pair<const int, std::vector<std::cxx11::basic_string<char>, std::allocator<std::cxx11::basic_string<char> > > > &' but 'const auto&' is always a valid option) or remove the reference to make it explicit that you are creating a new value [clang-tidy: performance-implicit-conversion-in-loop] for (const std::pair<int, std::vector<std::string>>& p : my_map) {} // performance-implicit-conversion-in-loop
^ | |
| toolkit/components/telemetry/build_scripts/gen_event_data.py | ||
| 41 | Error: Line too long (177 > 99 characters) [flake8: E501] | |
| 41 | Error: Missing whitespace around operator [flake8: E225] | |
| 41 | Error: At least two spaces before inline comment [flake8: E261] | |
| 65 | Error: Continuation line under-indented for visual indent [flake8: E128] | |
Code analysis found 7 defects in this patch:
- 7 defects found by clang-format
You can run this analysis locally with:
- ./mach clang-format -p path/to/file.cpp (C/C++)
If you see a problem in this automated review, please report it here: https://bit.ly/2tb8Qk3
A full diff for the formatting issues found by clang-format is provided here: https://queue.taskcluster.net/v1/task/local instance/runs/0/artifacts/public/results/PHID-DIFF-waci5wxslps37r7vhmvk-clang-format.diff
You can use it in your repository with hg import or git apply
| js/src/jsapi.cpp | ||
|---|---|---|
| 124–132 | Warning: Incorrect coding style [clang-format] const char* Test[] = { "line 1", "line 2", "line 3", "line 4", "line 5", "line 6" // misc-suspicious-missing-comma "line 7", "line 8", | |
| 140–143 | Warning: Incorrect coding style [clang-format] class AnnotateConflict MOZ_NO_DANGLING_ON_TEMPORARIES int* get() &&
{
return nullptr;
} // mozilla-dangling-on-temporary
MOZ_NO_DANGLING_ON_TEMPORARIES int test() { return 0; } // mozilla-dangling-on-temporary | |
| 190–195 | Warning: Incorrect coding style [clang-format] RootedValue val(cx, ObjectValue(*obj));
return ReportValueErrorFlags(
cx, flags, code_, JSDVG_IGNORE_STACK, val, nullptr, nullptr, nullptr);
}
else if (ErrorTakesArguments(
code_)) { // readability-misleading-indentation or readability-else-after-return | |
| 226–227 | Warning: Incorrect coding style [clang-format] { for (float x = 0.1f; x <= 1.0f; x += 0.1f) {
} // clang-analyzer-security.FloatLoopCounter | |
| 232–233 | Warning: Incorrect coding style [clang-format] int y = 0;
if (x < y)
; // misc-suspicious-semicolon | |
| 234–235 | Warning: Incorrect coding style [clang-format] {
x++; | |
| 364–365 | Warning: Incorrect coding style [clang-format] std::map<int, std::vector<std::string>> my_map;
for (const std::pair<int, std::vector<std::string>>& p : my_map) {
} // performance-implicit-conversion-in-loop | |
Code analysis found 7 defects in this patch:
- 7 defects found by clang-format
You can run this analysis locally with:
- ./mach clang-format -p path/to/file.cpp (C/C++)
If you see a problem in this automated review, please report it here: https://bit.ly/2tb8Qk3
For your convenience, here is a patch that fixes all the clang-format issues (use it in your repository with hg import or git apply):
https://queue.taskcluster.net/v1/task/local instance/runs/0/artifacts/public/results/PHID-DIFF-waci5wxslps37r7vhmvk-clang-format.diff
| js/src/jsapi.cpp | ||
|---|---|---|
| 124–132 | Warning: Incorrect coding style [clang-format] const char* Test[] = {
"line 1",
"line 2",
"line 3",
"line 4",
"line 5",
"line 6" // misc-suspicious-missing-comma
"line 7",
"line 8", | |
| 140–143 | Warning: Incorrect coding style [clang-format] class AnnotateConflict
{
MOZ_NO_DANGLING_ON_TEMPORARIES int* get() &&
{
return nullptr;
} // mozilla-dangling-on-temporary
MOZ_NO_DANGLING_ON_TEMPORARIES int test() { return 0; } // mozilla-dangling-on-temporary | |
| 190–195 | Warning: Incorrect coding style [clang-format] RootedValue val(cx, ObjectValue(*obj));
return ReportValueErrorFlags(
cx, flags, code_, JSDVG_IGNORE_STACK, val, nullptr, nullptr, nullptr);
}
else if (ErrorTakesArguments(
code_)) { // readability-misleading-indentation or readability-else-after-return | |
| 226–227 | Warning: Incorrect coding style [clang-format] {
for (float x = 0.1f; x <= 1.0f; x += 0.1f) {
} // clang-analyzer-security.FloatLoopCounter | |
| 232–233 | Warning: Incorrect coding style [clang-format] int y = 0;
if (x < y)
; // misc-suspicious-semicolon | |
| 234–235 | Warning: Incorrect coding style [clang-format] {
x++; | |
| 364–365 | Warning: Incorrect coding style [clang-format] std::map<int, std::vector<std::string>> my_map;
for (const std::pair<int, std::vector<std::string>>& p : my_map) {
} // performance-implicit-conversion-in-loop | |