Skip to content

Commit

Permalink
Fix switch default Signed-off-by: Carolina Oliveira <61292734+Carolin…
Browse files Browse the repository at this point in the history
[email protected]>

Signed-off-by: Carolina Oliveira <[email protected]>
  • Loading branch information
CarolinaOliiveira committed Sep 9, 2024
1 parent 515f464 commit 7eada19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public static List<Checksum> GetSpdxChecksums(this Component component)
ChecksumValue = hash.Content,
});
break;
default:
break;
}
}
}
Expand Down Expand Up @@ -164,6 +166,8 @@ public static List<Checksum> GetSpdxChecksums(this Component component)
ChecksumValue = checksum.Value,
});
break;
default:
break;
}
}
}
Expand Down Expand Up @@ -280,6 +284,8 @@ public static void AddSpdxChecksums(this Component component, List<Checksum> che
case ChecksumAlgorithm.ADLER32:
component.Properties.AddSpdxElement(PropertyTaxonomy.CHECKSUM_ADLER32, checksum.ChecksumValue);
break;
default:
break;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public static List<ExternalRef> GetSpdxExternalRefs(this Component component)
extRef.ReferenceCategory = ExternalRefCategory.PACKAGE_MANAGER;
extRef.ReferenceType = "purl";
break;
default:
break;
}
//TODO add this back in once the SPDX JSON schema is fixed https://github.com/spdx/spdx-spec/issues/612
//TODO and write corresponding code in AddExternalRefsToCDX
Expand Down Expand Up @@ -103,15 +105,8 @@ public static void AddSpdxExternalRefs(this Component component, List<ExternalRe
string refPropName = null;
if (extRef.ReferenceCategory == ExternalRefCategory.SECURITY)
{
switch (extRef.ReferenceType)
{
case "cpe22Type":
refPropName = PropertyTaxonomy.EXTERNAL_REFERENCE_SECURITY_CPE22;
break;
case "cpe23Type":
refPropName = PropertyTaxonomy.EXTERNAL_REFERENCE_SECURITY_CPE23;
break;
}
if(extRef.ReferenceType == "cpe22Type") { refPropName = PropertyTaxonomy.EXTERNAL_REFERENCE_SECURITY_CPE22; }
else if(extRef.ReferenceType == "cpe23Type"){ refPropName = PropertyTaxonomy.EXTERNAL_REFERENCE_SECURITY_CPE23; }
}
else if (extRef.ReferenceCategory == ExternalRefCategory.PACKAGE_MANAGER)
{
Expand All @@ -132,6 +127,8 @@ public static void AddSpdxExternalRefs(this Component component, List<ExternalRe
case "purl":
refPropName = PropertyTaxonomy.EXTERNAL_REFERENCE_PACKAGE_MANAGER_PURL;
break;
default:
break;
}
}
else if (extRef.ReferenceCategory == ExternalRefCategory.OTHER)
Expand Down

0 comments on commit 7eada19

Please sign in to comment.