Skip to content

Commit ac7116c

Browse files
committed
CM-55551 CLI SCA Scan Fails to Detect Indirect Dependencies Due to PNPM Lock File Handling
1 parent 119eab3 commit ac7116c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cycode/cli/files_collector/sca/base_restore_dependencies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ def get_working_directory(self, document: Document) -> Optional[str]:
8585
def get_restored_lock_file_name(self, restore_file_path: str) -> str:
8686
return self.get_lock_file_name()
8787

88-
def get_any_restore_file_already_exist(self, document: Document, restore_file_paths: list[str]) -> Optional[str]:
88+
def get_any_restore_file_already_exist(self, document: Document, restore_file_paths: list[str]) -> str:
8989
for restore_file_path in restore_file_paths:
9090
if os.path.isfile(restore_file_path):
9191
return restore_file_path
9292

9393
return build_dep_tree_path(document.absolute_path, self.get_lock_file_name())
9494

9595
@staticmethod
96-
def verify_restore_file_already_exist(restore_file_path: Optional[str]) -> bool:
96+
def verify_restore_file_already_exist(restore_file_path: str) -> bool:
9797
return os.path.isfile(restore_file_path)
9898

9999
@abstractmethod

cycode/cli/files_collector/sca/npm/restore_npm_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_commands(self, manifest_file_path: str) -> list[list[str]]:
3232
]
3333

3434
def get_restored_lock_file_name(self, restore_file_path: str) -> str:
35-
return NPM_LOCK_FILE_NAME if restore_file_path is None else os.path.basename(restore_file_path)
35+
return os.path.basename(restore_file_path)
3636

3737
def get_lock_file_name(self) -> str:
3838
return NPM_LOCK_FILE_NAME

0 commit comments

Comments
 (0)