Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Improve S3776: Exclude complexity of JSX short-circuits #377

Merged

Conversation

francoismora
Copy link
Contributor

Fixes SonarSource/SonarJS#3289

@francoismora francoismora force-pushed the issue-3289-cognitive-complexity-jsx-short-circuits branch from c234a0c to 29bd2b1 Compare November 30, 2022 11:42
@francoismora
Copy link
Contributor Author

As discussed, the rule checks that the short-circuit logical expression doesn't have a ternary operator at its right-hand side before deciding to exclude it from the cognitive complexity computation.
Also, the PR fixes an issue in the secondary locations of logical operators.

Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 comments, otherwise LGTM!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

97.3% 97.3% Coverage
0.0% 0.0% Duplication

@saberduck saberduck merged commit f757f28 into master Dec 5, 2022
@saberduck saberduck deleted the issue-3289-cognitive-complexity-jsx-short-circuits branch December 5, 2022 10:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve S3776: Exclude complexity of JSX attribute short-circuits
3 participants