diff --git a/README.md b/README.md index 164cca3..69b1c12 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,29 @@ Works with Java, Kotlin, and Python. I chose 8 points as a medium complexity method and use it as 100%. This means that all the methods above 100% are good candidates for splitting/improving. The formula is: `percentage = points / 8 * 100` +## Configuration + +You can find plugin configuration under `Settings` > `Tools` > `Code Complexity` + +--- +![Configuration example](images/screenshot-configuration.png) +--- + +## Inspection +There is an inspection added to support checking multiple files in your project. +All the supported languages of the plugin also work in inspection. +To run the inspection: `Search everywhere` > `Run inspection by Name...` > `High code complexity` + +The inspection works only on methods currently and will find all the methods with the very high complexity score. + +--- +![Configuration example](images/screenshot-inspection-results.png) +--- + + +> **_NOTE:_** You can enable inspection to work on the fly, but in this case it will do the same as code hints which are +> already in your editor - it will highlight the methods with the very high complexity score. + ## Release - Update version in `gradle.properties` diff --git a/images/screenshot-configuration.png b/images/screenshot-configuration.png new file mode 100644 index 0000000..efc2e73 Binary files /dev/null and b/images/screenshot-configuration.png differ diff --git a/images/screenshot-inspection-results.png b/images/screenshot-inspection-results.png new file mode 100644 index 0000000..3a45d4f Binary files /dev/null and b/images/screenshot-inspection-results.png differ diff --git a/src/main/kotlin/com/github/nikolaikopernik/codecomplexity/core/CodeComplexityInspection.kt b/src/main/kotlin/com/github/nikolaikopernik/codecomplexity/core/HighCodeComplexityInspection.kt similarity index 97% rename from src/main/kotlin/com/github/nikolaikopernik/codecomplexity/core/CodeComplexityInspection.kt rename to src/main/kotlin/com/github/nikolaikopernik/codecomplexity/core/HighCodeComplexityInspection.kt index 7400ce1..9dc78b9 100644 --- a/src/main/kotlin/com/github/nikolaikopernik/codecomplexity/core/CodeComplexityInspection.kt +++ b/src/main/kotlin/com/github/nikolaikopernik/codecomplexity/core/HighCodeComplexityInspection.kt @@ -18,7 +18,7 @@ import com.intellij.psi.PsiFile * @see ComplexityInfoProvider * @see visitFileFast */ -class KtHighComplexityInspection : LocalInspectionTool() { +class HighCodeComplexityInspection : LocalInspectionTool() { /** * Check file fast in 2 steps: diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index ecf8ed7..d243d62 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -33,7 +33,7 @@ hasStaticDescription="true" enabledByDefault="false" level="WARNING" - implementationClass="com.github.nikolaikopernik.codecomplexity.core.KtHighComplexityInspection"/> + implementationClass="com.github.nikolaikopernik.codecomplexity.core.HighCodeComplexityInspection"/> diff --git a/src/main/resources/inspectionDescriptions/HighComplexity.html b/src/main/resources/inspectionDescriptions/HighComplexity.html index e76a75a..b1c6742 100644 --- a/src/main/resources/inspectionDescriptions/HighComplexity.html +++ b/src/main/resources/inspectionDescriptions/HighComplexity.html @@ -1,4 +1,3 @@ - Reports methods with the high complexity score (very complex in configured limits - see Settings -> Tools -> Code complexity).
diff --git a/src/main/resources/inspectionDescriptions_zh_CN/HighComplexity.html b/src/main/resources/inspectionDescriptions_zh_CN/HighComplexity.html new file mode 100644 index 0000000..432dc8c --- /dev/null +++ b/src/main/resources/inspectionDescriptions_zh_CN/HighComplexity.html @@ -0,0 +1,5 @@ + + +报告具有高复杂性分数的方法(配置的限制非常复杂 - 请参阅设置 -> 工具 -> 代码复杂性)。 仅检查方法。 + +