Sema identifies Tech Debt in four categories we call Tech Debt Indicators.
- Duplicated Blocks of Code
- Complexity
- Line Level Warnings
- Test Lines
Duplicated Blocks of Code
The first tech debt indicator Sema recommends addressing is duplication. A duplicate block is a section of code that appears more than once in a repository. Identical blocks of code are tagged as duplicates, provided the block is at least 100 tokens long. Duplicates create additional work because developers need to make two or more times as many changes to code. Dealing with duplicates can eliminate duplicated debt by decreasing other indicators present in those blocks.
Complexity
Complexity counts IF and ELSE statements in code. Highly complex code is hard to work on, and hard to avoid, so we set a threshold for the complexity we aim to stay beneath. If your code base has lots of overly complex files, consider breaking them up into smaller, functional pieces. Your overall complexity might stay the same, but developers will be happy to work on fewer overly complex files.
Line Level Warnings
Sema analyzes your entire code base using a number of established tools and linters, with thousands of possible warnings. They range from small, stylistic issues to potential bugs. It's a good idea to reduce or eliminate these wherever they are found. To drill into these in greater detail, go to the Line Level page.
Test Lines
Sema provides an estimate of test coverage by counting lines of code in directories with 'test' or 'spec' in the name, and comparing that to non-test lines of code. Very good coverage would be around 1:1, or 1 line of test code to every 1 line of code.