Skip to content

Count ??, ??=, ||= and &&= in the JS cyclomatic complexity - #1264

Open
yuminn-k wants to merge 1 commit into
mozilla:masterfrom
yuminn-k:fix-js-lazy-ops-cyclomatic
Open

yuminn-k wants to merge 1 commit into
mozilla:masterfrom
yuminn-k:fix-js-lazy-ops-cyclomatic

Conversation

@yuminn-k

Copy link
Copy Markdown

Count the missing lazily evaluated operators in the JS-family cyclomatic complexity.

??, ??=, ||= and &&= short-circuit like || and &&, but the Mozjs, JavaScript, TypeScript and TSX implementations only counted || and &&. This adds QMARKQMARK, QMARKQMARKEQ, AMPAMPEQ and PIPEPIPEEQ to the four Cyclomatic impls, with one test per language. The new tests fail on master (sum 2.0 instead of 6.0) and pass with this change; cargo test --lib passes.

?. is left out on purpose: the issue lists it with a "maybe", and it is not a logical operator, so counting it is a separate decision for the maintainers.

Related to #788

This branch has not been deployed

No deployments
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.

1 participant