Initialize the compiler plugin for static code analysis#598
Initialize the compiler plugin for static code analysis#598daneshk merged 1 commit intoballerina-platform:masterfrom nureka-rodrigo:master
Conversation
...er-plugin-tests/src/test/resources/static_code_analyzer/ballerina_packages/rule1/aes_cbc.bal
Outdated
Show resolved
Hide resolved
MaryamZi
left a comment
There was a problem hiding this comment.
I think the title can be improved to include more context (e.g., for static code analysis)
compiler-plugin/src/main/java/io/ballerina/stdlib/crypto/compiler/CryptoCompilerPlugin.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
This PR initializes a Ballerina compiler plugin for static code analysis by adding the plugin modules, configuring their builds, and wiring up the plugin in project resources.
- Introduces
crypto-compiler-pluginand its test module in settings and Gradle configs - Implements core plugin classes (
RuleImpl,RuleFactory) and stub analyzers - Adds TOML resource entries and update tasks to register the plugin
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| settings.gradle | Included :crypto-compiler-plugin and its tests |
| gradle.properties | Added testngVersion, gsonVersion, balScanVersion |
| compiler-plugin/src/main/java/module-info.java | Declares io.ballerina.stdlib.crypto.compiler module |
| compiler-plugin/src/main/java/io/ballerina/stdlib/crypto/... | Adds RuleImpl, RuleFactory and empty analyzer shells |
| compiler-plugin/src/main/java/io/ballerina/stdlib/crypto/... | Provides empty CryptoRule, CryptoCodeAnalyzer, CryptoCipherAlgorithmAnalyzer |
| compiler-plugin/src/main/java/io/ballerina/stdlib/crypto/... | Adds empty CryptoCompilerPlugin entry class |
| compiler-plugin/build.gradle | Configures plugin dependencies, Checkstyle, SpotBugs |
| compiler-plugin-tests/build.gradle | Sets up plugin test project with TestNG and SpotBugs |
| build-config/resources/CompilerPlugin.toml | Registers plugin in build‐config resources |
| ballerina/build.gradle | Registers plugin build and TOML update tasks |
| ballerina/CompilerPlugin.toml | Template for plugin registration in Ballerina project |
Comments suppressed due to low confidence (2)
compiler-plugin/src/main/java/io/ballerina/stdlib/crypto/compiler/staticcodeanalyzer/RuleImpl.java:1
- Core logic in
RuleImplandRuleFactoryis untested. Add unit tests to verifyid()conversion and factory creation behavior.
/*
build-config/resources/CompilerPlugin.toml:6
- The version placeholder may not be replaced in this TOML. Ensure your update task handles this file or use a consistent placeholder strategy.
path = "../compiler-plugin/build/libs/crypto-compiler-plugin-@project.version@.jar"
...-plugin/src/main/java/io/ballerina/stdlib/crypto/compiler/staticcodeanalyzer/CryptoRule.java
Show resolved
Hide resolved
...src/main/java/io/ballerina/stdlib/crypto/compiler/staticcodeanalyzer/CryptoCodeAnalyzer.java
Show resolved
Hide resolved
...va/io/ballerina/stdlib/crypto/compiler/staticcodeanalyzer/CryptoCipherAlgorithmAnalyzer.java
Show resolved
Hide resolved
compiler-plugin/src/main/java/io/ballerina/stdlib/crypto/compiler/CryptoCompilerPlugin.java
Show resolved
Hide resolved
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #598 +/- ##
=========================================
Coverage 82.22% 82.22%
Complexity 239 239
=========================================
Files 29 29
Lines 1367 1367
Branches 190 190
=========================================
Hits 1124 1124
Misses 197 197
Partials 46 46 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Purpose
Description
Checklist