Skip to content

Fixing complexity issues in src/coverPhoto.js#43

Open
jeremy-ru wants to merge 3 commits into
CMU-17313Q:mainfrom
jeremy-ru:fix-complexity-coverPhoto
Open

Fixing complexity issues in src/coverPhoto.js#43
jeremy-ru wants to merge 3 commits into
CMU-17313Q:mainfrom
jeremy-ru:fix-complexity-coverPhoto

Conversation

@jeremy-ru
Copy link
Copy Markdown

@jeremy-ru jeremy-ru commented Sep 4, 2025

Resolve #33

Resolved the issue of high complexity (count = 12) in the getCover function within src/coverPhoto.js by refactoring the logic to get rid of nested if statements. By solving the deeply nested conditional structure, the readability and maintainability is improved. The core functionality for selecting and formatting cover images remains the same as the original version. This change also passed the npm lint and test as well as the Qlty smell issue, resolving #33 and keeping the coverage report to be mostly green.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17485555713

Details

  • 11 of 12 (91.67%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.001%) to 78.528%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/coverPhoto.js 11 12 91.67%
Files with Coverage Reduction New Missed Lines %
src/coverPhoto.js 1 84.38%
Totals Coverage Status
Change from base Build 17472903245: -0.001%
Covered Lines: 24692
Relevant Lines: 29607

💛 - 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.

P1B: Refactoring Code in src/coverPhoto.js

3 participants