Page MenuHomePhabricator Dev

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

Authored by janx on Aug 28 2018, 12:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 8, 4:27 PM
Unknown Object (File)
Aug 5 2026, 8:42 PM
Unknown Object (File)
Aug 5 2026, 8:42 PM
Unknown Object (File)
Jul 25 2026, 7:20 PM
Unknown Object (File)
Jul 21 2026, 6:23 PM
Unknown Object (File)
Jul 20 2026, 3:18 PM
Unknown Object (File)
Jul 20 2026, 3:14 AM
Unknown Object (File)
Jul 13 2026, 7:07 PM
Subscribers
None

Details

Reviewers
ReviewBot
Bugzilla Bug ID
1387052

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".Aug 28 2018, 12:25 PM
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
janx requested review of this revision.Aug 28 2018, 12:25 PM
janx retitled this revision from Bug 1387052 - Make Firefox code worse intentionally. r=reviewbot to Bug 1387052 - Make Firefox code worse intentionally 1/2. r=reviewbot.
janx added a reviewer: ReviewBot.

Rebased, validating staging.

Rebased on top of mozilla-central (hg), not gecko-dev (git).

Rebased on top of gecko-dev (Git) again.

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
146

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

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

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

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

Warning: Statement should be inside braces [clang-tidy: readability-braces-around-statements]

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

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

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

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]