Skip to content

Comments

Initialize the compiler plugin for static code analysis#598

Merged
daneshk merged 1 commit intoballerina-platform:masterfrom
nureka-rodrigo:master
Jun 18, 2025
Merged

Initialize the compiler plugin for static code analysis#598
daneshk merged 1 commit intoballerina-platform:masterfrom
nureka-rodrigo:master

Conversation

@nureka-rodrigo
Copy link
Contributor

@nureka-rodrigo nureka-rodrigo commented May 23, 2025

Purpose

Description

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@nureka-rodrigo nureka-rodrigo changed the title Initialize the compiler plugin and add rule to detect weak encryption algorithms Initialize the compiler plugin May 27, 2025
Copy link
Member

@MaryamZi MaryamZi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the title can be improved to include more context (e.g., for static code analysis)

@nureka-rodrigo nureka-rodrigo changed the title Initialize the compiler plugin Initialize the compiler plugin for static code analysis May 27, 2025
@keizer619 keizer619 requested a review from Copilot May 27, 2025 09:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-plugin and 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 RuleImpl and RuleFactory is untested. Add unit tests to verify id() 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"

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Jun 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.22%. Comparing base (6346d39) to head (b845dff).
Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daneshk daneshk merged commit 1d81d01 into ballerina-platform:master Jun 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants