

In short, Code Metrics is an important measure that let us understand the complexity and maintainability of the code. As a developer when you are writing your code, you must adhere those boundary values of metrics to ensure your code is well written, understandable and maintainable. No one likes over engineered or too complex code.

They can be bound in the keybindings.Code Metrics is one of the important software measures that give you an insight of your code maintainability and complexity.

someone uses 'any', it must be punished Description for the highest complexity level Hides code lenses with complexity lesser than the given value highest complexity level will be set when it exceeds 15 In the workspace settings one can override the defaults.įor a complete list please check the configuration section in the package.json.įor the most commonly used ones, one should do a search for codemetrics.basics How to install Visual Studio Code extensionsĭirect link to Visual Studio Code Marketplace Customization (This also allows You to quickly navigate to the corresponding code) If You want to know the causes You can click on the code lens to list all the entries for a given method or class. (content assist is provided for all of them for easier configuration).įor example if one prefers guard clauses,Īnd is ok with all the branches in switch statements then the following could be applied: "": 0, Project / team / personal taste by adjusting the relevant configuration entries Please also note that it is possible to balance the complexity calculation for the

Please note that it is not a standard metric, but it is a close approximation show the sum of complexity of child nodes for methods and the maximum of child nodes for classes.a textual representation for the node, complexity increment, child nodes etc.) This entry contains everything necessary for further use depending on the type of the node and the configuration associated with it create a new entry about the node.create an AST from the input source file.Code Metrics - Visual Studio Code ExtensionĬomputes complexity in TypeScript / JavaScript / Lua files.
