Skip to content

Conversation

@alerizzo
Copy link
Contributor

@alerizzo alerizzo commented Oct 20, 2025

  • Refactor configsetup/setup.go file breaking it down into 5 smaller files (same logic, just moved the functions around)
  • Fix Lizard analysis runner. It was expecting the jobs to return 1 (like I guess other linters do when they have findings). Problem is, Lizard is not a linter; it returns metrics. So it was not returning 1. Therefore, most of the times, the result was being ignored.
  • Fix Lizard configuration file creation. The logic it was looking for the parameters values inside of patternDefinition, but those are the default parameters set in the pattern's definition. It had to check the parameters in patternConfiguration instead.
  • Fixed a lot of Codacy issues (many also were already there, not new, but became new when moving those into new files).

https://codacy.atlassian.net/browse/CF-1999

@alerizzo alerizzo requested review from a team and Copilot October 20, 2025 14:53
@codacy-production
Copy link

codacy-production bot commented Oct 20, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.06% (target: -0.50%) 0.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (fd2d067) 5702 1156 20.27%
Head commit (5e3a2d0) 5718 (+16) 1156 (+0) 20.22% (-0.06%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#178) 553 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link
Contributor

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 fixes critical bugs in Lizard analysis execution and configuration generation, and refactors the configsetup package for better maintainability.

Key changes:

  • Corrects Lizard runner to properly handle non-linter exit codes by checking stderr instead of exit status
  • Fixes Lizard configuration creation to use PatternConfiguration parameters instead of PatternDefinition defaults
  • Refactors cmd/configsetup/setup.go by splitting it into 5 focused files for better code organization

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/lizard/lizardRunner.go Fixed error handling to use stderr checking instead of exit code interpretation
tools/lizard/lizardConfigCreator.go Corrected to extract threshold parameters from PatternConfiguration instead of PatternDefinition
cmd/configsetup/tool_creators.go New file containing tool configuration creator implementations (moved from setup.go)
cmd/configsetup/setup.go Reduced to interface definition only, all implementations moved to separate files
cmd/configsetup/repository_config.go New file containing repository configuration functions (moved from setup.go)
cmd/configsetup/default_config.go New file containing default configuration functions (moved from setup.go)
cmd/configsetup/config_creators.go New file containing general config file creators (moved from setup.go)
cmd/configsetup/codacy_yaml.go New file containing Codacy YAML template generation functions (moved from setup.go)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 20, 2025 15:30
Copy link
Contributor

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings October 21, 2025 08:35
Copy link
Contributor

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@alerizzo alerizzo changed the title fix: fix Lizard analysis run and configuration creation fix: fix Lizard analysis run and configuration creation CF-1999 Oct 21, 2025
@alerizzo alerizzo merged commit 06bb49b into main Oct 21, 2025
9 of 10 checks passed
@alerizzo alerizzo deleted the fix-lizard branch October 21, 2025 09:58
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.

3 participants