Skip to content

Commit b2867fc

Browse files
committed
publication
0 parents  commit b2867fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2038
-0
lines changed

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
*.iws
13+
*.iml
14+
*.ipr
15+
out/
16+
!**/src/main/**/out/
17+
!**/src/test/**/out/
18+
19+
### Eclipse ###
20+
.apt_generated
21+
.classpath
22+
.factorypath
23+
.project
24+
.settings
25+
.springBeans
26+
.sts4-cache
27+
bin/
28+
!**/src/main/**/bin/
29+
!**/src/test/**/bin/
30+
31+
### NetBeans ###
32+
/nbproject/private/
33+
/nbbuild/
34+
/dist/
35+
/nbdist/
36+
/.nb-gradle/
37+
38+
### VS Code ###
39+
.vscode/
40+
41+
### Mac OS ###
42+
.DS_Store

README.MD

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# CodeComplex by IFB ![Logo][logo]
2+
3+
_A lightweight plugin for JetBrains IDEs that reveals the runtime complexity of your methods with intuitive Big-O annotations._
4+
5+
---
6+
7+
## 🔍 What is CodeComplex?
8+
9+
**CodeComplex** analyzes your Java and Kotlin code and displays Big-O notation (`O(1)`, `O(n)`, `O(n²)`, etc.) above each method in real time — directly inside the editor.
10+
11+
This helps you:
12+
- Instantly understand the runtime complexity of your code.
13+
- Refactor complex logic early.
14+
- Teach and learn algorithmic thinking visually.
15+
16+
---
17+
18+
## 🛠️ Features
19+
20+
- 📊 Detects `for`, `*.forEach`, and other linear functions from JAVA API.
21+
- 🎯 Highlights methods with their estimated Big-O complexity.
22+
- ⚡ Supports Java and Kotlin.
23+
- 🧠 Powered by structural code analysis — no external tools required.
24+
25+
---
26+
27+
## 📸 Screenshots
28+
29+
![Kotlin](./public_data/gifs/kotlin_work.gif)
30+
![Java](./public_data/gifs/java_work_gif.gif)
31+
![Settings](./public_data/gifs/settings.gif)
32+
33+
![Screenshot 1](./public_data/code_sample_0.png)
34+
35+
![Screenshot 2](./public_data/code_sample_1.png)
36+
37+
---
38+
39+
## 🚀 Requirements
40+
41+
- JetBrains IntelliJ IDEA `2024.1` or newer.
42+
- Java and/or Kotlin codebase.
43+
44+
---
45+
46+
## 📦 Installation
47+
48+
Find **CodeComplex by IFB** on the JetBrains Marketplace, or install manually:
49+
50+
1. Go to **Settings > Plugins > Marketplace**.
51+
2. Search for `CodeComplex`.
52+
3. Click **Install** and restart the IDE.
53+
54+
---
55+
56+
57+
## 🧑‍💻 Author
58+
59+
Crafted with ❤️ by **IFB** - intfloatbool - Vladimir Khanyakin.
60+
Follow me for more tools and plugins.
61+
62+
---
63+
64+
## License
65+
66+
MIT License
67+
68+
---
69+
70+
[logo]: ./public_data/pluginIcon.png "Plugin Logo"
71+
[screenshot1]: ./screenshot1.png "Example 1"
72+
[screenshot2]: ./screenshot2.png "Example 2"

build.gradle.kts

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
plugins {
2+
id("java")
3+
4+
id("org.jetbrains.kotlin.jvm") version "1.9.25"
5+
id("org.jetbrains.intellij.platform") version "2.3.0"
6+
}
7+
8+
group = "com.intfloatbool"
9+
version = "1.0"
10+
11+
kotlin {
12+
jvmToolchain(21)
13+
}
14+
15+
16+
repositories {
17+
mavenCentral()
18+
intellijPlatform {
19+
defaultRepositories()
20+
}
21+
}
22+
23+
// Configure Gradle IntelliJ Plugin
24+
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html
25+
dependencies {
26+
intellijPlatform {
27+
create("IC", "2024.2.5")
28+
//intellijIdeaCommunity("2024.2.1")
29+
// testFramework(org.jetbrains.intellij.platform.gradle.TestFrameworkType.Platform)
30+
31+
// Add necessary plugin dependencies for compilation here, example:
32+
bundledPlugin("com.intellij.java")
33+
bundledPlugin("org.jetbrains.kotlin")
34+
35+
36+
}
37+
implementation("io.github.tree-sitter:ktreesitter:0.24.1")
38+
// jna уже есть в клиенте jetbrains (поэтому complieOnly), иначе будетjava.lang.NoClassDefFoundError
39+
compileOnly("net.java.dev.jna:jna:5.13.0")
40+
testImplementation(kotlin("test"))
41+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
42+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
43+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.0")
44+
45+
46+
}
47+
48+
intellijPlatform {
49+
pluginConfiguration {
50+
ideaVersion {
51+
sinceBuild = "241"
52+
}
53+
54+
changeNotes = """
55+
Initial version
56+
""".trimIndent()
57+
}
58+
}
59+
60+
tasks {
61+
// Set the JVM compatibility versions
62+
withType<JavaCompile> {
63+
sourceCompatibility = "21"
64+
targetCompatibility = "21"
65+
}
66+
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
67+
kotlinOptions.jvmTarget = "21"
68+
}
69+
}
70+
71+
tasks.test {
72+
useJUnitPlatform()
73+
}
74+
75+
tasks.processResources {
76+
from("src/main/resources/lib") {
77+
into("lib")
78+
}
79+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
80+
}
81+
82+
tasks {
83+
patchPluginXml {
84+
sinceBuild.set("241")
85+
untilBuild.set("999.*") // или просто убери
86+
}
87+
88+
buildPlugin {
89+
dependsOn(patchPluginXml)
90+
}
91+
}

gradle.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2+
kotlin.stdlib.default.dependency=false
3+
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
4+
org.gradle.configuration-cache=true
5+
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
6+
org.gradle.caching=true

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)