Sonar cloud fixes for 9.5 - #1077
Conversation
| 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); |
There was a problem hiding this comment.
Related sonar cloud failure: https://sonarcloud.io/project/issues?open=AY3s6h72MlpV5xQqWqXG&id=com.synopsys.integration%3Asynopsys-detect
| shadedDependenciesStuff(dependency); | ||
| } | ||
|
|
||
| private void shadedDependenciesStuff(ScopedDependency dependency) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
| } | ||
| } | ||
|
|
||
| private void moveToMethod(YarnLockDependency dependency, String dependencyVersion, Dependency parent, LazyBuilderMissingExternalIdHandler lazyBuilderHandler, ExternalIdDependencyGraphBuilder graphBuilder, BasicDependencyGraph mutableDependencyGraph,LazyId stringDependencyId) throws MissingExternalIdException { |
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
includeNonProductionOrOptionalIfNeeded(...)
* 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.
Please see comment on each code change for related sonar cloud issue