Skip to content

Commit 78e0a0c

Browse files
committed
feat(sasts): provide CPU_COUNT for SAST tool's command
1 parent 59955ea commit 78e0a0c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

codesectools/sasts/tools/Cppcheck/sast.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
SASTRequirements,
1414
)
1515
from codesectools.sasts.tools.Cppcheck.parser import CppcheckAnalysisResult
16+
from codesectools.utils import CPU_COUNT
1617

1718

1819
class CppcheckSAST(PrebuiltBuildlessSAST):
@@ -51,6 +52,7 @@ class CppcheckSAST(PrebuiltBuildlessSAST):
5152
"--xml",
5253
"--output-file=cppcheck_output.xml",
5354
"--cppcheck-build-dir={tempdir}",
55+
f"-j{CPU_COUNT}",
5456
]
5557
]
5658
valid_codes = [0]

codesectools/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,6 @@ def shorten_path(p: str) -> str:
223223
if len(path.parts) > 3:
224224
return str(Path("...") / path.parts[-2] / path.parts[-1])
225225
return p
226+
227+
228+
CPU_COUNT = os.cpu_count()

0 commit comments

Comments
 (0)