Skip to content

breaking: remove unused fields from FileMetrics - #108

Merged
lolgab merged 1 commit into
masterfrom
remove-unused-filemetrics-fields
Aug 31, 2026
Merged

breaking: remove unused fields from FileMetrics#108
lolgab merged 1 commit into
masterfrom
remove-unused-filemetrics-fields

Conversation

@lolgab

@lolgab lolgab commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove lineComplexities, nrMethods, nrClasses, cloc from FileMetrics — none referenced anywhere in this repo.
  • Removed LineComplexity case class too, since it only backed lineComplexities.

Test plan

  • sbt codacy-plugins-apiJVM/compile
  • sbt codacy-plugins-apiJVM/test

Drop lineComplexities, nrMethods, nrClasses, cloc — unused anywhere
in this repo. LineComplexity case class removed too since it only
backed lineComplexities.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Although the code quality is technically up to standards according to Codacy, this PR introduces significant breaking changes to the 'codacy-plugins-api' library. Removing fields from the 'FileMetrics' case class and deleting 'LineComplexity' breaks binary compatibility, source compatibility (specifically pattern matching), and JSON serialization for any downstream services or plugins. These issues should prevent merging unless a breaking release is intended. A deprecation strategy is recommended over total removal to maintain stability for external consumers.

About this PR

  • This is a breaking change for any external consumers of the 'codacy-plugins-api' library. Removing these fields will likely break integration with external plugins or tools that rely on the stable API contract of this package.

Test suggestions

  • Verify that existing code using FileMetrics with the remaining fields (filename, complexity, loc) still compiles and functions.
  • Ensure serialization/deserialization of FileMetrics works correctly with the reduced field set.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that existing code using FileMetrics with the remaining fields (filename, complexity, loc) still compiles and functions.
2. Ensure serialization/deserialization of FileMetrics works correctly with the reduced field set.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

lineComplexities: Set[LineComplexity] = Set.empty)

case class LineComplexity(line: Int, value: Int)
case class FileMetrics(filename: String, complexity: Option[Int] = None, loc: Option[Int] = None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 HIGH RISK

Removing fields from the 'FileMetrics' case class and deleting the 'LineComplexity' class are breaking changes for source and binary compatibility. Any consumer performing pattern matching on 'FileMetrics' or referencing 'LineComplexity' will fail to compile. Furthermore, this change modifies the serialized JSON structure, which can break integrations that rely on the presence of these keys. Consider restoring the removed fields and marking them with the '@deprecated' annotation, providing default values (e.g., None or Set.empty) to maintain backward compatibility.

@lolgab lolgab changed the title refactor: remove unused fields from FileMetrics clean: remove unused fields from FileMetrics Aug 31, 2026
@lolgab lolgab changed the title clean: remove unused fields from FileMetrics breaking: remove unused fields from FileMetrics Aug 31, 2026
@lolgab
lolgab merged commit 43c06d0 into master Aug 31, 2026
3 checks passed
@lolgab
lolgab deleted the remove-unused-filemetrics-fields branch August 31, 2026 14:54
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.

2 participants