Page MenuHomePhabricator Dev

Bug 1387052 - Make Firefox code worse intentionally. r=reviewbot
Needs ReviewPublic

Authored by janx on Jul 13 2018, 3:55 PM.
Tags
None
Referenced Files
F67106215: D541.1792475986.diff
Mon, Oct 19, 5:59 AM
Unknown Object (File)
Wed, Oct 14, 4:14 AM
Unknown Object (File)
Tue, Oct 13, 11:04 PM
Unknown Object (File)
Tue, Oct 13, 12:57 PM
Unknown Object (File)
Sat, Oct 10, 10:37 AM
Unknown Object (File)
Aug 4 2026, 9:33 AM
Unknown Object (File)
Aug 3 2026, 7:48 AM
Unknown Object (File)
Aug 1 2026, 8:51 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Bugzilla Bug ID
1387052

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Branch
worse (branched from master)
Build Status
Buildable 608
Build 764: arc lint + arc unit

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".Jul 13 2018, 3:56 PM
phab-bot changed the edit policy from "Custom Policy" to "All Users".
phab-bot removed a project: Restricted Project.
janx requested review of this revision.Jul 13 2018, 3:56 PM

Code analysis found 11 defects in this patch:

  • 4 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)

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
125

Warning: Suspicious string literal, probably missing a comma [clang-tidy: misc-suspicious-missing-comma]

"line 6"     // misc-suspicious-missing-comma
^
137

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
                                    ^
138

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
                                   ^
toolkit/components/telemetry/gen_event_data.py
37

Error: Missing whitespace around operator [flake8: E225]

37

Error: At least two spaces before inline comment [flake8: E261]

37

Error: Line too long (177 > 99 characters) [flake8: E501]

57

Error: Continuation line under-indented for visual indent [flake8: E128]

Cherry-picked a second fix, expecting 10 clang-tidy issues.

Code analysis found 17 defects in this patch:

  • 10 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)

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
125

Warning: Suspicious string literal, probably missing a comma [clang-tidy: misc-suspicious-missing-comma]

"line 6"     // misc-suspicious-missing-comma
^
137

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
                                    ^
138

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

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
^~~~~~~~
225

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
^
227

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
^
231

Warning: Potentially unintended semicolon [clang-tidy: misc-suspicious-semicolon]

if (x < y); // misc-suspicious-semicolon
          ^
249

Warning: Value stored to 'x' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores]

x = 1; // clang-analyzer-deadcode.DeadStores
^
348

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/gen_event_data.py
37

Error: Missing whitespace around operator [flake8: E225]

37

Error: At least two spaces before inline comment [flake8: E261]

37

Error: Line too long (177 > 99 characters) [flake8: E501]

57

Error: Continuation line under-indented for visual indent [flake8: E128]

Trying out reviewbot on staging to validate the next release.

Code analysis found 17 defects in this patch:

  • 10 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)

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
125

Warning: Suspicious string literal, probably missing a comma [clang-tidy: misc-suspicious-missing-comma]

"line 6"     // misc-suspicious-missing-comma
^
137

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
                                    ^
138

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

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
^~~~~~~~
225

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
^
227

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
^
231

Warning: Potentially unintended semicolon [clang-tidy: misc-suspicious-semicolon]

if (x < y); // misc-suspicious-semicolon
          ^
249

Warning: Value stored to 'x' is never read [clang-tidy: clang-analyzer-deadcode.DeadStores]

x = 1; // clang-analyzer-deadcode.DeadStores
^
348

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/gen_event_data.py
37

Error: Missing whitespace around operator [flake8: E225]

37

Error: At least two spaces before inline comment [flake8: E261]

37

Error: Line too long (177 > 99 characters) [flake8: E501]

57

Error: Continuation line under-indented for visual indent [flake8: E128]