Skip to content

Commit

Permalink
Some polishing before releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaikopernik committed Jan 22, 2024
1 parent 114ecee commit 7d70cec
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 3 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Binary file added images/screenshot-configuration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/screenshot-inspection-results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
hasStaticDescription="true"
enabledByDefault="false"
level="WARNING"
implementationClass="com.github.nikolaikopernik.codecomplexity.core.KtHighComplexityInspection"/>
implementationClass="com.github.nikolaikopernik.codecomplexity.core.HighCodeComplexityInspection"/>
</extensions>

</idea-plugin>
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<html>
<body>
Reports methods with the high complexity score (very complex in configured limits - see Settings -> Tools -> Code complexity). <br>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
报告具有高复杂性分数的方法(配置的限制非常复杂 - 请参阅设置 -> 工具 -> 代码复杂性)。 仅检查方法。
</body>
</html>

0 comments on commit 7d70cec

Please sign in to comment.