Showing 45 of 45 total issues
Consider simplifying this complex logical expression. Open
Open
if(smbVersion >= 2 && smbVersion < 3) { scriptFindings.push({ name: "SMB Protocol Version Finding v"+smbVersion, description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: `+ smbVersion, category: 'SMB',
Method ScanReconciler.startParser
has 10 return statements (exceeds 4 allowed). Open
Open
func (r *ScanReconciler) startParser(scan *executionv1.Scan) error { ctx := context.Background() namespacedName := fmt.Sprintf("%s/%s", scan.Namespace, scan.Name) log := r.Log.WithValues("scan_parse", namespacedName)
Consider simplifying this complex logical expression. Open
Open
if(smbVersion > 0 && smbVersion < 2) { scriptFindings.push({ name: "SMB Dangerous Protocol Version Finding v"+smbVersion, description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: ` + smbVersion, category: 'SMB',
Method ScanReconciler.startReadOnlyHooks
has 9 return statements (exceeds 4 allowed). Open
Open
func (r *ScanReconciler) startReadOnlyHooks(scan *executionv1.Scan) error { ctx := context.Background() var scanCompletionHooks executionv1.ScanCompletionHookList
Method ScheduledScanReconciler.Reconcile
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *ScheduledScanReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { ctx := context.Background() log := r.Log.WithValues("scheduledscan", req.NamespacedName) // get the ScheduledScan
Method ScanReconciler.ensureServiceAccountExists
has 7 return statements (exceeds 4 allowed). Open
Open
func (r *ScanReconciler) ensureServiceAccountExists(namespace, serviceAccountName, description string, policyRules []rbacv1.PolicyRule) error { ctx := context.Background() var serviceAccount corev1.ServiceAccount err := r.Get(ctx, types.NamespacedName{Name: serviceAccountName, Namespace: namespace}, &serviceAccount)
Avoid deeply nested control flow statements. Open
Open
if(smbVersion >= 2 && smbVersion < 3) { scriptFindings.push({ name: "SMB Protocol Version Finding v"+smbVersion, description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: `+ smbVersion, category: 'SMB',
Avoid deeply nested control flow statements. Open
Open
if status.Name == container && status.State.Terminated != nil { log.Printf("Main Container Exited. Lurcher will end as well.") return }
Avoid deeply nested control flow statements. Open
Open
if(smbVersion >= 3) { scriptFindings.push({ name: "SMB Protocol Version Finding v"+smbVersion, description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with version: ` + smbVersion, category: 'SMB',
Avoid deeply nested control flow statements. Open
Open
if(smbVersion > 0 && smbVersion < 2) { scriptFindings.push({ name: "SMB Dangerous Protocol Version Finding v"+smbVersion, description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: ` + smbVersion, category: 'SMB',
Consider simplifying this complex logical expression. Open
Open
if(elem.toString().includes("SMBv1")) { scriptFindings.push({ name: "SMB Dangerous Protocol Version Finding SMBv1", description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with an old version: SMBv1`, category: 'SMB',
Consider simplifying this complex logical expression. Open
Open
if(smbVersion >= 3) { scriptFindings.push({ name: "SMB Protocol Version Finding v"+smbVersion, description: `Port ${host.openPorts[0].port} is ${host.openPorts[0].state} using SMB protocol with version: ` + smbVersion, category: 'SMB',
Method ScheduledScanReconciler.SetupWithManager
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *ScheduledScanReconciler) SetupWithManager(mgr ctrl.Manager) error { if err := mgr.GetFieldIndexer().IndexField(&executionv1.Scan{}, ownerKey, func(rawObj runtime.Object) []string { // grab the job object, extract the owner... scan := rawObj.(*executionv1.Scan) owner := metav1.GetControllerOf(scan)
Method ScanReconciler.SetupWithManager
has 5 return statements (exceeds 4 allowed). Open
Open
func (r *ScanReconciler) SetupWithManager(mgr ctrl.Manager) error { r.MinioClient = *r.initS3Connection() // Todo: Better config management
Function analyseCertificateDeployments
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
function analyseCertificateDeployments(serverScanResult) { const certificateInfos = serverScanResult.scan_commands_results.certificate_info.certificate_deployments.map( analyseCertificateDeployment );
- Read upRead up
Function generateLabelSelectorString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export function generateLabelSelectorString({ matchExpression = [], matchLabels = new Map()}: LabelSelector): string { const matchLabelsSelector = Array.from(Object.entries(matchLabels)).map(
- Read upRead up
Avoid too many return
statements within this function. Open
Open
return ["Embedded Device", INFORMATIONAL];
Avoid too many return
statements within this function. Open
Open
return ["Potential Backup File", INFORMATIONAL];
Avoid too many return
statements within this function. Open
Open
return ["Identified Software", INFORMATIONAL];
Avoid too many return
statements within this function. Open
Open
return ["Identified Software", INFORMATIONAL];