Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code smells in SonarQube #161

Merged
merged 5 commits into from
Apr 12, 2024
Merged

Fix code smells in SonarQube #161

merged 5 commits into from
Apr 12, 2024

Conversation

SmetDenis
Copy link
Member

The PHP scripts (build-preloader.php and random-csv.php) used in Docker have been refactored to use new CSV tool classes instead of self-contained solutions. New PreloadBuilder and RandomCsvGenerator classes are introduced for better reusability and tests for these new classes have been added. Also, minor adjustments on SonarQube regex checks and the project readme were made.

The PHP scripts (`build-preloader.php` and `random-csv.php`) used in Docker have been refactored to use new CSV tool classes instead of self-contained solutions. New `PreloadBuilder` and `RandomCsvGenerator` classes are introduced for better reusability and tests for these new classes have been added. Also, minor adjustments on SonarQube regex checks and the project readme were made.
Copy link

github-actions bot commented Apr 12, 2024

Pull Request Test Coverage Report for Build 8662712446

Details

  • 36 of 49 (73.47%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 95.65%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Tools/RandomCsvGenerator.php 10 11 90.91%
src/Tools/PreloadBuilder.php 23 35 65.71%
Totals Coverage Status
Change from base Build 8653662484: -0.3%
Covered Lines: 3298
Relevant Lines: 3448

💛 - Coveralls

@SmetDenis SmetDenis changed the title Refactor Docker PHP scripts and add new tool classes Fixing code smells after SonarQube Apr 12, 2024
Renamed the variable `isCompiler` to `enableOpcacheCompiler` in the PreloadBuilder to enhance clarity and reflect its purpose more accurately. This change was applied in the build-preloader.php, PreloadBuilder.php, and PreloadBuilderTest.php files.
Copy link

github-actions bot commented Apr 12, 2024

Pull Request Test Coverage Report for Build 8663146787

Details

  • 50 of 52 (96.15%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 95.972%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Tools/PreloadBuilder.php 37 38 97.37%
src/Tools/RandomCsvGenerator.php 10 11 90.91%
Totals Coverage Status
Change from base Build 8653662484: -0.001%
Covered Lines: 3312
Relevant Lines: 3451

💛 - Coveralls

Refactored test method name in PreloadBuilderTest for clarity. Added new test `testPreloaderWithCompiling` to cover more cases, primarily for PreloadBuilder with opcache compiler enabled. Check for specific function existence in compiled contents.
The refactoring of PreloadBuilder pivots from handling class lists to managing file lists, with its related functions and output messages updated accordingly. This revamp includes the removal of '/app/csv-blueprint.php' from the exclusions list. Tests have been adjusted as well to mirror these alternations, adding the check for 'vendor/autoload.php'.
This change refactors PreloadBuilder to handle file lists instead of classes, ensuring the files are unique. Additionally, it updates the excluded files to be more specific and includes both 'csv-blueprint' and 'csv-blueprint.php' in the project root directory.
@SmetDenis SmetDenis changed the title Fixing code smells after SonarQube Fix code smells in SonarQube Apr 12, 2024
@SmetDenis SmetDenis merged commit 7701d8a into master Apr 12, 2024
12 checks passed
@SmetDenis SmetDenis deleted the fix-code-smells branch April 12, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant