hooks/persistence-defectdojo/hook/src/main/java/io/securecodebox/persistence/strategies/VersionedEngagementsStrategy.java
Method run
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public List<Finding> run(Scan scan, ScanFile scanResultFile) throws DefectDojoPersistenceException {
log.debug("Getting DefectDojo User Id via user profile API");
final List<UserProfile> userProfiles;
File VersionedEngagementsStrategy.java
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// SPDX-FileCopyrightText: the secureCodeBox authors
//
// SPDX-License-Identifier: Apache-2.0
package io.securecodebox.persistence.strategies;
Method createEngagement
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public Engagement createEngagement(Scan scan, Long productId, Long userId) throws URISyntaxException, JsonProcessingException {
String engagementName = this.getEngagementsName(scan);
List<String> tags = scan.getEngagementTags().orElseGet(List::of);
String version = scan.getEngagementVersion().orElse("");
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public List<Finding> run(Scan scan, ScanFile scanResultFile) throws DefectDojoPersistenceException {
log.debug("Getting DefectDojo User Id via user profile API");
final List<UserProfile> userProfiles;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"