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

Sonar cloud fixes for 9.5 #1077

Merged
merged 5 commits into from
Mar 21, 2024
Merged

Conversation

shantyk
Copy link
Contributor

@shantyk shantyk commented Mar 21, 2024

Please see comment on each code change for related sonar cloud issue

@shantyk shantyk changed the base branch from master to 9.5.z March 21, 2024 18:56
@@ -134,7 +134,7 @@ private DependencyGraph buildGraphForProject(
if (shouldInclude(entryName, entry.getVersion())) {
LazyId id = generateComponentDependencyId(entryName, entry.getVersion());
graphBuilder.setDependencyInfo(id, entryName, entry.getVersion(), generateComponentExternalId(entryName, entry.getVersion()));
ExternalIdDependencyGraphBuilder.LazyDependencyInfo parentInfo = graphBuilder.checkAndHandleMissingExternalId(lazyBuilderHandler, id);
LazyExternalIdDependencyGraphBuilder.LazyDependencyInfo parentInfo = graphBuilder.checkAndHandleMissingExternalId(lazyBuilderHandler, id);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shantyk shantyk requested a review from gopannabd March 21, 2024 19:05
shadedDependenciesStuff(dependency);
}

private void shadedDependenciesStuff(ScopedDependency dependency) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simply moved the last chunk of code that was added in the commit form yesterday @devmehtasynopsys, this does resolve the complaint. If you're okay with this and don't believe this will cause any issues I don't see, please suggest a more appropriate method name (I lack context for these changes).

Sonar issue: https://sonarcloud.io/project/issues?impactSeverities=HIGH&resolved=false&severities=CRITICAL&id=com.synopsys.integration%3Asynopsys-detect&open=AY5erg-0_RLhWwYvLB2A

Copy link
Contributor

@devmehtabd devmehtabd Mar 21, 2024

Choose a reason for hiding this comment

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

Yeah this would be okay to do and it won't cause any issues. The appropriate method name for this would addShadedDependenciesToGraph, as we are adding them to the graph.

@shantyk shantyk requested a review from devmehtabd March 21, 2024 19:09
}
}
}

private void moveToMethod(YarnLockDependency dependency, String dependencyVersion, Dependency parent, LazyBuilderMissingExternalIdHandler lazyBuilderHandler, ExternalIdDependencyGraphBuilder graphBuilder, BasicDependencyGraph mutableDependencyGraph,LazyId stringDependencyId) throws MissingExternalIdException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gopannabd Moved last if block to a method, please suggest an appropriate name. Also, please review for any issues that may not be obvious to someone without context into this method ... such as whether or not passing the relevant objects around via parameters could cause any issues or not.. etc). In general I lack context into this area of the code, let me know what you think overall.

Sonar issue: https://sonarcloud.io/project/issues?open=AY36qfWcZptyxDnuTZGc&id=com.synopsys.integration%3Asynopsys-detect

Copy link
Contributor

Choose a reason for hiding this comment

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

includeNonProductionOrOptionalIfNeeded(...)

@shantyk shantyk merged commit f333292 into 9.5.z Mar 21, 2024
@shantyk shantyk deleted the dev/shanty/more-sonar-cloud-fixes-for-9.5 branch March 21, 2024 20:18
andrian-sevastyanov pushed a commit that referenced this pull request Mar 22, 2024
* Fix sonar cloud complaint about using static access for parent class

* Attempt at refactoring to reduce method complexity complaint by sonar

* Update method name as per Dev's suggestion

* Attempt at reducing method complexity from 22 to 17

* Reduce method complexity from 17 to less than 15 to resolve sonar cloud issue.
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.

3 participants