Skip to content

Commit

Permalink
Refactor scan model response variable assignment
Browse files Browse the repository at this point in the history
Simplified the retrieval of config and engines by using a single variable, `scanModelResponse`, to improve code readability and maintainability. This change consolidates access to elements of `allScansModel.Scans[0]` into one clear reference point, making the code easier to understand and modify in the future.
  • Loading branch information
BenAlvo1 committed Dec 5, 2024
1 parent d4851e7 commit c33d259
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/commands/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,9 @@ func getResubmitConfiguration(scansWrapper wrappers.ScansWrapper, projectID, use
}

if len(allScansModel.Scans) > 0 {
config = allScansModel.Scans[0].Metadata.Configs
engines := allScansModel.Scans[0].Engines
scanModelResponse := allScansModel.Scans[0]
config = scanModelResponse.Metadata.Configs
engines := scanModelResponse.Engines
// Check if there are no scan types sent using the flags, and use the latest scan engine types
if userScanTypes == "" {
actualScanTypes = strings.Join(engines, ",")
Expand Down

0 comments on commit c33d259

Please sign in to comment.