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

Refactoring code complexity in src/middleware/render.js #58

Open
wants to merge 11 commits into
base: f24
Choose a base branch
from

Conversation

zanzoonh
Copy link

@zanzoonh zanzoonh commented Sep 2, 2024

resolves #52

Fixed three errors in the code:

  • Cognitive complexity of processRender function from 16 to 15 - by moving out part of the code into a different function
  • Cognitive complexity of loadClientHeaderFooterData from 27 to 15 - by moving most of the code into separate functions, and doing early returns
  • Deep nesting of the functions - by extracting the deeply nested functions and declaring them outside.

Changes have been tested by the SonarCloud Quality Gate and by using the lint and test suite provided

Copy link

sonarqubecloud bot commented Sep 4, 2024

@coveralls
Copy link

Pull Request Test Coverage Report for Build 10707231925

Details

  • 40 of 40 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 82.747%

Totals Coverage Status
Change from base Build 10550029021: 0.08%
Covered Lines: 22342
Relevant Lines: 25586

💛 - Coveralls

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.

Refactoring code in src/middleware/render.js
2 participants