![]() |
FOSSology
4.5.1
Open Source License Compliance by Open Source Software
|
Public Member Functions | |
def | __init__ (self, CliOptions cli_options, Packages scan_packages) |
Packages | get_scan_packages (self) |
bool | is_excluded_path (self, str path) |
None | set_copyright_list (self, bool all_results=False, bool whole=False) |
None | set_keyword_list (self, bool whole=False) |
list[ScanResult]|list[ScanResultList] | get_non_allow_listed_results (self, list[ScanResult] scan_results=None, list[ScanResultList] scan_results_whole=None, bool whole=False) |
list[ScanResult] | get_non_allow_listed_copyrights (self) |
list[ScanResultList] | get_copyright_results (self) |
list[ScanResultList] | get_keyword_results (self) |
list[ScanResultList] | get_license_results (self) |
list[ScanResult]|list[ScanResultList] | results_are_allow_listed (self, bool whole=False) |
None | set_scanner_results (self, bool whole=False) |
Static Public Attributes | |
str | |
Private Member Functions | |
str | __normalize_path (self, str path, str against) |
dict | _execute_scanner_command (self, str scanner_path, str dir_to_scan, list[str] extra_args=None) |
dict | __get_nomos_result (self, str dir_to_scan) |
dict | __get_ojo_result (self, str dir_to_scan) |
dict | __get_copyright_results (self, str dir_to_scan) |
dict | __get_keyword_results (self, str dir_to_scan) |
list[ScanResult]|list[ScanResultList] | _process_single_scanner_package (self, dict component, bool is_parent, callable scanner_func, str result_key, bool whole=False, bool all_results=False) |
None | __set_license_nomos (self, bool whole=False) |
None | __set_license_ojo (self, bool whole=False) |
list[ScanResult] | __merge_nomos_ojo (self, list[ScanResult] nomos_licenses, list[ScanResult] ojo_licenses) |
Private Attributes | |
_allowlist_licenses_set | |
Handle all the data from different scanners. :ivar nomos_path: path to nomos bin :ivar copyright_path: path to copyright bin :ivar keyword_path: path to keyword bin :ivar ojo_path: path to ojo bin :ivar cli_options: CliOptions object
Definition at line 55 of file Scanners.py.
def FoScanner.Scanners.Scanners.__init__ | ( | self, | |
CliOptions | cli_options, | ||
Packages | scan_packages | ||
) |
Initialize the cli_options :param cli_options: CliOptions object to use :type cli_options: CliOptions :param scan_packages: ScanPackages for references :type scan_packages: Packages
Definition at line 70 of file Scanners.py.
|
private |
Get the raw results from copyright scanner :return: raw json from copyright
Definition at line 175 of file Scanners.py.
|
private |
Get the raw results from keyword scanner :return: raw json from keyword
Definition at line 183 of file Scanners.py.
|
private |
Get the raw results from nomos scanner :return: raw json from nomos
Definition at line 156 of file Scanners.py.
|
private |
Get the raw results from ojo scanner :return: raw json from ojo
Definition at line 167 of file Scanners.py.
|
private |
Merge the results from nomos and ojo based on file name
Definition at line 359 of file Scanners.py.
|
private |
Normalize the given path against the given directory. :param path: path to normalize :param against: directory to normalize against :return: Normalized path
Definition at line 102 of file Scanners.py.
|
private |
Update the packages with formatted results of nomos scanner
Definition at line 325 of file Scanners.py.
|
private |
Update the packages with formatted results of ojo scanner
Definition at line 342 of file Scanners.py.
|
private |
Helper to execute a scanner command and return its JSON output.
Definition at line 119 of file Scanners.py.
|
private |
Generalized function to process results from a single scanner for a given component. Set `result_key` to 'results' for copyrights and 'licenses' for license scanning.
Definition at line 191 of file Scanners.py.
list[ScanResultList] FoScanner.Scanners.Scanners.get_copyright_results | ( | self | ) |
Get list of copyright scan results from the package list.
Definition at line 419 of file Scanners.py.
list[ScanResultList] FoScanner.Scanners.Scanners.get_keyword_results | ( | self | ) |
Get list of keywords scan results from the package list.
Definition at line 431 of file Scanners.py.
list[ScanResultList] FoScanner.Scanners.Scanners.get_license_results | ( | self | ) |
Get list of license scan results from the package list.
Definition at line 443 of file Scanners.py.
list[ScanResult] FoScanner.Scanners.Scanners.get_non_allow_listed_copyrights | ( | self | ) |
Get copyrights from files which are not allow listed.
Definition at line 411 of file Scanners.py.
list[ScanResult] | list[ScanResultList] FoScanner.Scanners.Scanners.get_non_allow_listed_results | ( | self, | |
list[ScanResult] | scan_results = None , |
||
list[ScanResultList] | scan_results_whole = None , |
||
bool | whole = False |
||
) |
Get results where license check failed.
Definition at line 375 of file Scanners.py.
bool FoScanner.Scanners.Scanners.is_excluded_path | ( | self, | |
str | path | ||
) |
Check if the path is allow listed The function used fnmatch to check if the path is in allow list or not. :param path: path to check :return: True if the path is in allow list, False otherwise
Definition at line 88 of file Scanners.py.
list[ScanResult] | list[ScanResultList] FoScanner.Scanners.Scanners.results_are_allow_listed | ( | self, | |
bool | whole = False |
||
) |
Get the formatted list of license scanner findings The list contains the merged result of nomos/ojo scanner based on cli_options passed
Definition at line 455 of file Scanners.py.
None FoScanner.Scanners.Scanners.set_copyright_list | ( | self, | |
bool | all_results = False , |
||
bool | whole = False |
||
) |
Set the formatted results from copyright scanner for the components.
Definition at line 285 of file Scanners.py.
None FoScanner.Scanners.Scanners.set_keyword_list | ( | self, | |
bool | whole = False |
||
) |
Get the formatted results from keyword scanner
Definition at line 306 of file Scanners.py.
None FoScanner.Scanners.Scanners.set_scanner_results | ( | self, | |
bool | whole = False |
||
) |
Set the key `SCANNER_RESULTS` for all components in scan_packages using nomos and ojo scanners (whichever is selected).
Definition at line 481 of file Scanners.py.