Page MenuHomePhabricator

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

Authored by janx on Jan 15 2018, 2:32 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Bugzilla Bug ID
Not provided
Summary

MozReview-Commit-ID: 65EixGF10HH

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Branch
default
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 798
Build 866: arc lint + arc unit

Event Timeline

Static analysis found 18 defects in this patch.

  • 8 defects found by clang-format
  • 4 defects found by clang-tidy
  • 6 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 check path/to/file (Python/Javascript/wpt)

If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx

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-xiiqglwqw2tjrqdb3g3w-clang-format.diff

You can use it in your repository with hg import or git apply

devtools/client/definitions.js
7–8

Error: Linting issue [mozlint: eslint]

Infix operators must be spaced.

devtools/client/shared/scroll.js
7–8

Error: Linting issue [mozlint: eslint]

Parsing error: Unexpected character '#'

js/src/ctypes/libffi/src/prep_cif.c
81–90

Warning: Incorrect coding style [clang-format]
Replace by:

#ifdef FFI_AGGREGATE_ALIGNMENT

if (FFI_AGGREGATE_ALIGNMENT > arg->alignment)
    arg->alignment = FFI_AGGREGATE_ALIGNMENT;

#endif

if (arg->size == 0)
    return FFI_BAD_TYPEDEF;
else // readability-else-after-return
    return FFI_OK;
js/src/jsalloc.cpp
15–23

Warning: Incorrect coding style [clang-format]
Replace by:

const char* Test[] = { "line 1",

"line 2" // misc-suspicious-missing-comma
"line 3",
"line 4",
"line 5" };
26–28

Warning: Incorrect coding style [clang-format]
Replace by:

{

for (float x = 0.1f; x <= 1.0f; x += 0.1f) {
} // clang-analyzer-security.FloatLoopCounter
35–37

Warning: Incorrect coding style [clang-format]
Replace by:

int y = 0;
if (x < y)
    ; // misc-suspicious-semicolon
37–39

Warning: Incorrect coding style [clang-format]
Replace by:

{
    x++;
js/src/jsapi.cpp
125–129

Warning: Incorrect coding style [clang-format]
Replace by:

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
127–128

Error: Methods annotated with moz_no_dangling_on_temporaries cannot be && ref-qualified [clang-tidy: mozilla-dangling-on-temporary]

127–128

Error: Methods annotated with moz_no_dangling_on_temporaries cannot be && ref-qualified [clang-tidy: mozilla-dangling-on-temporary]

128–129

Error: Methods annotated with moz_no_dangling_on_temporaries must return a pointer [clang-tidy: mozilla-dangling-on-temporary]

128–129

Error: Methods annotated with moz_no_dangling_on_temporaries must return a pointer [clang-tidy: mozilla-dangling-on-temporary]

175–179

Warning: Incorrect coding style [clang-format]
Replace by:

    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
330–332

Warning: Incorrect coding style [clang-format]
Replace by:

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
toolkit/components/telemetry/gen_event_data.py
35–36

Error: Linting issue [mozlint: flake8]

missing whitespace around operator

35–36

Error: Linting issue [mozlint: flake8]

at least two spaces before inline comment

35–36

Error: Linting issue [mozlint: flake8]

line too long (177 > 99 characters)

55–56

Error: Linting issue [mozlint: flake8]

continuation line under-indented for visual indent