Skip to content

matkoch/resharper-cognitivecomplexity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

923770e · Jan 17, 2025
Jun 26, 2024
Nov 13, 2024
Jun 26, 2024
Jan 17, 2025
Jan 31, 2023
Feb 26, 2019
Jun 26, 2024
Jan 17, 2025
Feb 1, 2023
Aug 15, 2024
Dec 17, 2019
Feb 26, 2019
Sep 24, 2019
Jun 26, 2024
Nov 26, 2020
Sep 24, 2019
Apr 12, 2023
Dec 6, 2023
Jan 17, 2025
Jun 26, 2024
Jun 26, 2024
Aug 8, 2019
Feb 28, 2019
Apr 12, 2023
Jun 26, 2024
Jun 26, 2024
Apr 19, 2022
Feb 28, 2019

Repository files navigation

CognitiveComplexity for Rider and ReSharper

Rider ReSharper

This plugin implements live calculation of the Cognitive Complexity metric, which was proposed by G. Ann Campbell in Cognitive Complexity - A new way of measuring understandability (c) SonarSource S.A. 2016-2018, Switzerland.

Abstract: Cyclomatic Complexity was initially formulated as a measurement of the "testability and maintainability" of the control flow of a module. While it excels at measuring the former, its underlying mathematical model is unsatisfactory at producing a value that measures the latter. This white paper describes a new metric that breaks from the use of mathematical models to evaluate code in order to remedy Cyclomatic Complexity’s shortcomings and produce a measurement that more accurately reflects the relative difficulty of understanding, and therefore of maintaining methods, classes, and applications.

Configuration

A options page is located under Frameworks & Languages | Cognitive Complexity, which allows to configure the visual representation.

⚠️ Changing a value might require focusing another input to apply it. This is currently a bug on Rider side.

The language specific threshold indicates what you consider the maximum allowed value for the Cognitive Complexity metric. Code Vision thresholds define how the value is represented in the UI:

Depending on your individual preferences, you can disable for instance the simple enough interval, by changing it's percentage threshold to the same as mildly complex. Setting simple enough to a value of 0 would remove the simple gray diamond.