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

Refactored from 17 to 15 in cognitive complexity src/categories/create.js #45

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

Conversation

lhitmi
Copy link

@lhitmi lhitmi commented Sep 2, 2024

This refactor introduces a local variable cloneFromCid to store the parsed integer value, reducing redundant parseInt calls. The if condition is now only checks cloneFromCid, which handles invalid cases due to parseInt returning NaN for non-numeric strings. This overall reduces the cognitive complexity from 17 to 15. Resolves #25

@coveralls
Copy link

coveralls commented Sep 2, 2024

Pull Request Test Coverage Report for Build 10673316856

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.005%) to 82.666%

Files with Coverage Reduction New Missed Lines %
src/meta/errors.js 1 76.74%
src/categories/create.js 1 86.11%
Totals Coverage Status
Change from base Build 10550029021: -0.005%
Covered Lines: 22324
Relevant Lines: 25584

💛 - Coveralls

Copy link

sonarcloud bot commented Sep 2, 2024

@lhitmi lhitmi changed the title refactored from 17 to 15 Refactored from 17 to 15 in cognitive complexity src/categories/create.js Sep 4, 2024
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/categories/create.js
2 participants