DEV Community

Cover image for Tackle code complexity within VS Code Editor
Romanelapolutak
Romanelapolutak

Posted on

Tackle code complexity within VS Code Editor

In this tutorial we learn how you can use CodeScene's IDE Extension for VS Code to reduce code complexity while writing the code, in real time.

It's a free, standalone version of CodeScene's code health analysis, supporting all the popular languages.

It performs the analysis in the background automatically and reports any issues right next to your code. See below.

Examples

Issues are displayed above the affected functions. Clicking on them shows an explanation.

Issues are displayed above the affected functions. Clicking on them shows an explanation.

Issues are registered as warnings and collected in the Problems tab.

Issues are registered as warnings and collected in the Problems tab.

A score based on the CodeScene code health concept is shown at the top of the file.

A score based on the CodeScene code health concept is shown at the top of the file.

Tutorial: You can find the tutorial here.

Extension can be found here
Install the VS Code Extension here.

Some of the Code Health Factors measured:

  • Nested complexity (highly nested if-statements or loops)

  • Bumpy road (multiple chunks of nested complexity)

  • Complex functions (measured as high cyclomatic complexity)

  • Functions with too many arguments

  • Functions that are too long

  • You can find more detailed information for each Code Health issue by drilling down in the editor.

Top comments (0)