Page MenuHomePhabricator Dev

Static Analysis bot's playground
Needs ReviewPublic

Authored by • BastienAbadie on Dec 4 2017, 12:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 11, 3:23 PM
Unknown Object (File)
Jul 22 2026, 5:23 AM
Unknown Object (File)
Jul 17 2026, 2:37 AM
Unknown Object (File)
Jul 15 2026, 8:31 PM
Unknown Object (File)
Jun 14 2026, 9:21 AM
Unknown Object (File)
Jun 12 2026, 1:58 PM
Unknown Object (File)
Apr 15 2026, 10:57 AM
Unknown Object (File)
Apr 14 2026, 10:17 PM
Subscribers
None
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Bugzilla Bug ID
Not provided
Summary

Import of review test bug : https://reviewboard.mozilla.org/r/164530/

Event Timeline

This comment was removed by • BastienAbadie.
js/src/jsalloc.cpp
3–4

Test phabricator bot

Done.

js/src/jsalloc.cpp
3–4

Test phabricator bot

3–4

Test phabricator bot

3–4

Test phabricator bot

3–4

Test phabricator bot

C/C++ static analysis found 14 defects in this patch.

  • 6 defects found by clang-tidy
  • 8 defects found by clang-format

You can run this analysis locally with: ./mach static-analysis check path/to/file.cpp and ./mach clang-format -p path/to/file.cpp

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

You can use it in your repository with hg import

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
36–37

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

37–39

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

{
    x++;
48–49

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

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]

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
178–179

Warning: Do not use 'else' after 'return' [clang-tidy: readability-else-after-return]

311–312

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'
319–321

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

C/C++ static analysis found 1 defect in this patch.

  • 0 defects found by clang-tidy
  • 0 defects found by clang-format

You can run this analysis locally with: ./mach static-analysis check path/to/file.cpp and ./mach clang-format -p path/to/file.cpp

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

js/src/jsalloc.cpp
3–4

Test phabricator bot