Mobile/Fennec/Android/Static analysis: Difference between revisions

From MozillaWiki
< Mobile‎ | Fennec‎ | Android
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Android Lint ==
#REDIRECT [[Mobile/Fennec/Android/Testing#Quick_reference]]
Catches various errors & optimizations specifically related to Android code and resources
./mach gradle app:lint
 
* '''example checks?''' [https://sites.google.com/a/android.com/tools/tips/lint-checks `lint --show`]
* '''in automation?''' Treeherder tier 2 "Unit" job
* '''config?''' [http://mxr.mozilla.org/mozilla-central/source/mobile/android/app/lint.xml mobile/android/app/lint.xml]
* '''open issues?''' Run locally for a complete list.
* '''meta bug?''' [https://bugzilla.mozilla.org/show_bug.cgi?id=1170283 meta bug]
* If you fix all issues for a warning, modify [http://mxr.mozilla.org/mozilla-central/source/mobile/android/app/lint.xml lint.xml] to change your warning into an error!
 
== Facebook Infer ==
Currently detects NullPointerExceptions and resource leaks in Android applications.
 
It's currently unknown how to run locally.
 
* '''in automation?''' [https://people.mozilla.org/~sledru/reports/fennec-infer/bugs.txt updated daily] – planned move [https://bugzilla.mozilla.org/show_bug.cgi?id=1258469 to Task Cluster]
* '''config?''' N/A
* '''open issues?''' See the automation link
* '''meta bug?''' [https://bugzilla.mozilla.org/show_bug.cgi?id=1175203 meta bug]
 
== checkstyle ==
Checks code style
./mach gradle app:checkstyle
 
* '''example checks?''' [http://checkstyle.sourceforge.net/google_style.html Google's style guide]
* '''in automation?''' [https://bugzilla.mozilla.org/show_bug.cgi?id=1258787 In progress]
* '''config?''' [http://mxr.mozilla.org/mozilla-central/source/mobile/android/app/checkstyle.xml mobile/android/app/checkstyle.xml]
* '''open issues?''' Issues we care about are blocking the meta
* '''meta bug?''' [https://bugzilla.mozilla.org/show_bug.cgi?id=1170283 meta bug]
 
== Coverity ==
Cloud-based static analysis that catches many miscellaneous Java errors, e.g. null dereference & dead code
 
https://scan.coverity.com/projects/firefox-mobile
 
* '''example checks?''' N/A
* '''in automation?''' See above link
* '''config?''' Configured online
* '''open issues?''' See online
* '''meta bug?''' [https://bugzilla.mozilla.org/show_bug.cgi?id=1248773 meta bug]
* You must be added as a member of the Coverity project in order to interact with the dashboard – talk to :Sylvestre
* You can sign up for email notifications (via the online interface) when new Coverity defects are found
 
== eslint ==
Checks for Javascript errors (e.g. syntax errors, almost like a compiled language! :D)
./mach eslint --setup  # run once, or if the command breaks for some reason
./mach eslint mobile/android
 
* '''example checks?''' http://eslint.org/docs/rules/
* '''in automation?''' Treeherder tier 1 "ES" job
* '''config?''' [http://mxr.mozilla.org/mozilla-central/find?string=.eslint&tree=mozilla-central&hint=mobile%2F mobile/*.eslintrc] & [http://mxr.mozilla.org/mozilla-central/source/.eslintignore root .eslintignore]
* '''open issues?''' Open a .eslintrc and enable checks.
* '''meta bug?''' [https://bugzilla.mozilla.org/show_bug.cgi?id=939329 meta bug]
* If you fix all issues for a warning, modify the appropriate .eslintrc to change your warning into an error!

Latest revision as of 17:49, 9 May 2016