Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 35 additions & 26 deletions backend/entities/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,47 @@ type ScanArgDef struct {
Shorthand string
Default interface{}
Usage string
Tooltip string
Type string
IsCore bool
IsFileSelector bool
}

var (
ScanArguments = []ScanArgDef{
{"wfp", "w", "", "Scan a WFP File instead of a folder (optional)", "string", false, true},
{"dep", "p", "", "Use a dependency file instead of a folder (optional)", "string", false, true},
{"stdin", "s", "", "Scan the file contents supplied via STDIN (optional)", "string", false, false},
{"files", "e", []string{}, "List of files to scan.", "stringSlice", false, false},
{"identify", "i", "", "Scan and identify components in SBOM file", "string", false, true},
{"ignore", "n", "", "Ignore components specified in the SBOM file", "string", false, true},
{"output", "o", "", "Output result file name (optional - default stdout).", "string", true, true},
{"format", "f", "plain", "Result output format (optional - default: plain)", "string", false, false},
{"threads", "T", 5, "Number of threads to use while scanning (optional - default 5)", "int", false, false},
{"flags", "F", 0, "Scanning engine flags", "int", false, false},
{"post-size", "P", 32, "Number of kilobytes to limit the post to while scanning (optional - default 32)", "int", false, false},
{"timeout", "M", 180, "Timeout (in seconds) for API communication (optional - default 180)", "int", false, false},
{"retry", "R", 5, "Retry limit for API communication (optional - default 5)", "int", false, false},
{"no-wfp-output", "", false, "Skip WFP file generation", "bool", false, false},
{"dependencies", "D", false, "Add Dependency scanning", "bool", false, false},
{"dependencies-only", "", false, "Run Dependency scanning only", "bool", false, false},
{"sc-command", "", "", "Scancode command and path if required (optional - default scancode).", "string", false, false},
{"sc-timeout", "", 600, "Timeout (in seconds) for scancode to complete (optional - default 600)", "int", false, false},
{"dep-scope", "", "", "Filter dependencies by scope - default all (options: dev/prod)", "string", false, false},
{"dep-scope-inc", "", "", "Include dependencies with declared scopes", "string", false, false},
{"dep-scope-exc", "", "", "Exclude dependencies with declared scopes", "string", false, false},
{"settings", "", "", "Settings file to use for scanning (optional - default scanoss.json)", "string", true, true},
{"skip-settings-file", "", false, "Skip default settings file (scanoss.json) if it exists", "bool", false, false},
{"debug", "d", false, "Enable debug messages", "bool", true, false},
{"trace", "t", false, "Enable trace messages, including API posts", "bool", true, false},
{"quiet", "q", true, "Enable quiet mode", "bool", true, false},
{"wfp", "w", "", "Scan a WFP File instead of a folder (optional)", "", "string", false, true},
{"dep", "p", "", "Use a dependency file instead of a folder (optional)", "", "string", false, true},
{"stdin", "s", "", "Scan the file contents supplied via STDIN (optional)", "", "string", false, false},
{"files", "e", []string{}, "List of files to scan.", "", "stringSlice", false, false},
{"identify", "i", "", "Scan and identify components in SBOM file", "", "string", false, true},
{"ignore", "n", "", "Ignore components specified in the SBOM file", "", "string", false, true},
{"output", "o", "", "Output result file name (optional - default stdout).",
"Location where the scan results will be saved", "", true, true},
{"format", "f", "plain", "Result output format (optional - default: plain)", "", "string", false, false},
{"threads", "T", 5, "Number of threads to use while scanning (optional - default 5)",
"", "int", false, false},
{"flags", "F", 0, "Scanning engine flags",
"Advanced scanning engine configuration flags", "int", false, false},
{"post-size", "P", 32, "Number of kilobytes to limit the post to while scanning (optional - default 32)",
"Limits the size of each scan request to improve performance and reliability", "int", false, false},
{"timeout", "M", 180, "Timeout (in seconds) for API communication (optional - default 180)", "", "int", false, false},
{"retry", "R", 5, "Retry limit for API communication (optional - default 5)", "", "int", false, false},
{"no-wfp-output", "", false, "Skip WFP file generation", "", "bool", false, false},
{"dependencies", "D", false, "Add Dependency scanning", "", "bool", false, false},
{"dependencies-only", "", false, "Run Dependency scanning only", "", "bool", false, false},
{"sc-command", "", "", "Scancode command and path if required (optional - default scancode).", "", "string", false, false},
{"sc-timeout", "", 600, "Timeout (in seconds) for scancode to complete (optional - default 600)", "", "int", false, false},
{"dep-scope", "", "", "Filter dependencies by scope - default all (options: dev/prod)", "", "string", false, false},
{"dep-scope-inc", "", "", "Include dependencies with declared scopes", "", "string", false, false},
{"dep-scope-exc", "", "", "Exclude dependencies with declared scopes", "", "string", false, false},
{"settings", "", "", "Settings file to use for scanning (optional - default scanoss.json)",
"Configuration file that defines scanning behavior and rules", "string", true, true},
{"skip-settings-file", "", false, "Skip default settings file (scanoss.json) if it exists", "", "", false, false},
{"debug", "d", false, "Enable debug messages",
"Show detailed diagnostic information during scanning", "bool", true, false},
{"trace", "t", false, "Enable trace messages, including API posts",
"Display all API communication and detailed execution steps", "bool", true, false},
{"quiet", "q", true, "Enable quiet mode",
"Suppress non-essential output messages", "bool", true, false},
}
)
2 changes: 1 addition & 1 deletion frontend/src/components/ScanDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default function ScanDialog({ onOpenChange }: ScanDialogProps) {
type={arg.Type.toLowerCase() as 'string' | 'int' | 'bool' | 'stringSlice'}
value={options[arg.Name]}
defaultValue={arg.Default}
usage={arg.Usage}
tooltip={arg.Tooltip}
onChange={(value) => handleOptionChange(arg.Name, value)}
onSelectFile={arg.IsFileSelector ? () => handleFileSelect(arg.Name)() : undefined}
isFileSelector={arg.IsFileSelector}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/ScanOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ interface ScanOptionProps {
type: 'string' | 'int' | 'bool' | 'stringSlice';
value: string | number | boolean | string[];
defaultValue: string | number | boolean | string[];
usage: string;
tooltip: string;
onChange: (value: string | number | boolean | string[]) => void;
onSelectFile?: () => void;
isFileSelector?: boolean;
}

export default function ScanOption({ name, type, value, defaultValue, usage, onChange, onSelectFile, isFileSelector }: ScanOptionProps) {
export default function ScanOption({ name, type, value, defaultValue, tooltip, onChange, onSelectFile, isFileSelector }: ScanOptionProps) {
const displayName = name
.split('-')
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
Expand Down Expand Up @@ -132,7 +132,7 @@ export default function ScanOption({ name, type, value, defaultValue, usage, onC
<Tooltip>
<TooltipTrigger asChild>{renderInput()}</TooltipTrigger>
<TooltipContent>
<p>{usage}</p>
<p>{tooltip}</p>
</TooltipContent>
</Tooltip>
);
Expand Down
2 changes: 2 additions & 0 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export namespace entities {
Shorthand: string;
Default: any;
Usage: string;
Tooltip: string;
Type: string;
IsCore: boolean;
IsFileSelector: boolean;
Expand All @@ -389,6 +390,7 @@ export namespace entities {
this.Shorthand = source["Shorthand"];
this.Default = source["Default"];
this.Usage = source["Usage"];
this.Tooltip = source["Tooltip"];
this.Type = source["Type"];
this.IsCore = source["IsCore"];
this.IsFileSelector = source["IsFileSelector"];
Expand Down
Loading