Open Bug 1553495 Opened 3 years ago Updated 1 month ago

[clang-tidy] Investigate the possibility of enabling: readability-magic-numbers

Categories

(Developer Infrastructure :: Source Code Analysis, task)

task
Not set
normal

Tracking

(Not tracked)

People

(Reporter: andi, Unassigned)

References

Details

Since in Bug 1551842 we've added new checkers from clang-tidy 8.0 we've also seen this new checkers readability-magic-numbers that in the above mentioned bug has been added but it's disabled since we must see first it's impact on our code and later on, if it confirms it's feasibility, we should enable it.
A good start would be to have a rough estimation on how many issues it finds on Gecko.

Component: Lint and Formatting → Source Code Analysis

it founds 18461 defects on the tree (includes thirdparties)
but there are some dumb false positives which should be reported upstream.

For example, the position in the array is reported:
https://searchfox.org/mozilla-central/source/parser/html/nsHtml5AttributeName.cpp#2302

But it finds other things which would be useful for readability

Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.