Static code analysis can detect Unreachable statement - code above always terminates.
The vast majority of occurrences in the Arcanist codebase are due to an unreachable break within a case after a return or after an all-covering if/else.
All this noise makes it harder to spot real logic issues (there are some!), thus fix these trivial cases.
Details
Details
- Reviewers
valerio.bozzolan - Group Reviewers
O1: Blessed Committers - Commits
- rARCb888963f6ff5: Remove trivial cases of unreachable code
Examine the code; run static code analysis.
Diff Detail
Diff Detail
- Repository
- rARC Arcanist
- Branch
- unreachableCode
- Lint
Lint Passed - Unit
Test Failures - Build Status
Buildable 1563 Build 1563: arc lint + arc unit
Time | Test | |
---|---|---|
724 ms | ArcanistBundleTestCase::testGitRepository EXCEPTION (Exception): Expected patch and actual patch for 5dec8bf28557f078d1987c4e8cfb53d08310f522 differ. Wrote actual patch to '/var/www/html/phorge/arcanist/src/parser/__tests__/patches//5dec8bf28557f078d1987c4e8cfb53d08310f522.gitpatch.real'.
#0 /var/www/html/phorge/arcanist/src/parser/__tests__/ArcanistBundleTestCase.php(85): ArcanistBundleTestCase->runGitRepositoryTests(Object(PhutilDirectoryFixture))
#1 /var/www/html/phorge/arcanist/src/unit/engine/phutil/PhutilTestCase.php(639): ArcanistBundleTestCase->testGitRepository()
| |
75 ms | ArcanistBaseCommitParserTestCase::testBasics 2 assertion(s) passed. | |
74 ms | ArcanistBaseCommitParserTestCase::testHalt 1 assertion(s) passed. | |
88 ms | ArcanistBaseCommitParserTestCase::testJump 1 assertion(s) passed. | |
75 ms | ArcanistBaseCommitParserTestCase::testJumpReturn 1 assertion(s) passed. | |
View Full Test Results (1 Failed · 88 Passed) |