{"schema_version":"2","scorer_version":"0.1.0","scoring_version":"prov-5+qual-2+sec-2","generated_at":"2026-11-14T14:52:00.728702Z","repo":{"ref":{"host":"github.com","owner":"Jack-Lee-Hiter","name":"AlgorithmsByPython"},"default_branch":"master","clone_url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython.git","html_url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython","description":"算法/数据结构/Python/剑指offer/机器学习/leetcode","stars":4077,"forks":1297,"is_fork":false,"is_archived":false,"is_private":false,"size_kb":315,"primary_language":"Python","license_spdx":null,"created_at":"2016-06-27T14:39:00Z","pushed_at":"2020-01-19T13:58:31Z","security_policy_url":null,"distribution":{"owner_created_at":"2015-11-21T03:07:05Z","owner_type":"User","release_assets":[]}},"commit_sha":"78d7ac4d93db9da40601a5567350bfb3e97e7d46","profile":{"lines_by_language":{"Python":7702,"Shell":27},"files_by_category":{"source":152,"docs":11,"other":8,"config":7,"binary":4},"source_lines":7729,"test_lines":0},"pillars":{"ai_provenance":{"score":0.0,"confidence":0.65,"coverage":1.0,"label":"none-detected","breakdown":{"attributed_share":0.0,"suspected_share":0.0,"estimated_share":0.0,"ai_artifacts":0.0,"flagged_work_units":0.0,"flagged_releases":null,"style_index":0.0},"summary":"No AI attribution or AI-consistent velocity signals detected."},"quality":{"score":42.2,"confidence":0.9,"coverage":1.0,"label":"poor","breakdown":{"complexity":95.7,"duplication":36.5,"lint":49.1,"testing":0.0,"docs":40.0,"type_safety":40.0,"process":null},"summary":"Code quality is poor: test-to-source ratio 0.00, no CI test run detected; 1% of function code in complex or long functions; 17% duplicated lines. Weakest area: testing."},"security":{"score":81.6,"confidence":0.85,"coverage":1.0,"label":"adequate","breakdown":{"secrets":100.0,"sast":99.3,"dependencies":null,"ci_actions":null,"posture":0.0,"scorecard":null},"summary":"Security posture is adequate: no high-impact findings. Weakest area: posture."}},"analyzer_results":[{"analyzer":"sec-scorecard","pillar":"security","status":"skipped","tool_version":null,"metrics":{},"findings":[],"evidence":[],"data":{},"error":"no published OpenSSF Scorecard result for this repo"},{"analyzer":"sec-registry","pillar":"security","status":"skipped","tool_version":null,"metrics":{},"findings":[],"evidence":[],"data":{},"error":"no registry dependencies declared"},{"analyzer":"ai-attribution","pillar":"ai_provenance","status":"ok","tool_version":"signatures-v1","metrics":{"commits":115.0,"attributed_commits":0.0,"attributed_commit_share":0.0,"effective_loc":3304.0,"attributed_loc":0.0,"attributed_loc_share":0.0,"tools_detected":0.0},"findings":[],"evidence":[],"data":{"attributed_loc_by_commit":{},"tools":{},"monthly":{"2016-06":{"loc":336,"attributed_loc":0},"2016-07":{"loc":1797,"attributed_loc":0},"2016-08":{"loc":1054,"attributed_loc":0},"2016-09":{"loc":103,"attributed_loc":0},"2017-05":{"loc":0,"attributed_loc":0},"2017-11":{"loc":0,"attributed_loc":0},"2018-08":{"loc":14,"attributed_loc":0}}},"error":null},{"analyzer":"ai-artifacts","pillar":"ai_provenance","status":"ok","tool_version":"signatures-v1","metrics":{"artifacts":0.0,"workflow_agents":0.0,"tools_configured":0.0},"findings":[],"evidence":[],"data":{"artifacts":[],"workflows":[],"tools":[]},"error":null},{"analyzer":"ai-velocity","pillar":"ai_provenance","status":"ok","tool_version":"prov-4","metrics":{"work_units":42.0,"flagged_units":0.0,"pre_ai_era_bursts":0.0,"pre_ai_era_measured_loc":3304.0,"pre_ai_era_burst_loc":0.0,"measured_loc":3304.0,"flagged_loc":0.0,"flagged_loc_share":0.0,"max_loc_per_hour":181.0,"median_loc_per_hour":36.0,"pr_timed_units":0.0,"excluded_import_loc":0.0},"findings":[],"evidence":[],"data":{"flagged_loc_by_commit":{},"excluded_import_commits":[]},"error":null},{"analyzer":"ai-release-velocity","pillar":"ai_provenance","status":"skipped","tool_version":null,"metrics":{},"findings":[],"evidence":[],"data":{},"error":null},{"analyzer":"ai-stylometry","pillar":"ai_provenance","status":"ok","tool_version":null,"metrics":{"lines_scanned":7729.0,"index":0.0,"count:narrated_steps":0.0,"per_kloc:narrated_steps":0.0,"files:narrated_steps":0.0,"count:placeholder":0.0,"per_kloc:placeholder":0.0,"files:placeholder":0.0,"count:emoji_in_code":0.0,"per_kloc:emoji_in_code":0.0,"files:emoji_in_code":0.0,"count:assistant_voice":0.0,"per_kloc:assistant_voice":0.0,"files:assistant_voice":0.0},"findings":[],"evidence":[],"data":{},"error":null},{"analyzer":"sec-secrets","pillar":"security","status":"ok","tool_version":"gitleaks 8.30.1","metrics":{"secrets_current":0.0,"secrets_history":0.0,"secrets_nonprod":0.0,"secrets_low_confidence":0.0},"findings":[],"evidence":[],"data":{},"error":null},{"analyzer":"sec-sast","pillar":"security","status":"ok","tool_version":"opengrep 1.33.1; rules f1d2b562b414","metrics":{"findings":1.0,"findings_high":0.0,"findings_medium":0.0,"findings_low":1.0,"weighted_findings":0.15,"scanned_lines":7729.0,"parse_errors":1.0},"findings":[{"rule_id":"opengrep/python.lang.security.audit.insecure-transport.requests.request-with-http","severity":"low","message":"Detected a request using 'http://'. This request will be unencrypted, and attackers could listen into traffic on the network and be able to obtain sensitive information. Use 'https://' instead. [confidence medium]","path":"regularExpression/re练习.py","line":12,"fingerprint":"python.lang.security.audit.insecure-transport.requests.request-with-http:regularExpression/re练习.py:12"}],"evidence":[],"data":{"rulesets":["python","bash"]},"error":null},{"analyzer":"sec-deps","pillar":"security","status":"skipped","tool_version":null,"metrics":{},"findings":[],"evidence":[],"data":{},"error":null},{"analyzer":"sec-actions","pillar":"security","status":"skipped","tool_version":null,"metrics":{},"findings":[],"evidence":[],"data":{},"error":null},{"analyzer":"sec-posture","pillar":"security","status":"ok","tool_version":null,"metrics":{"check:security_policy":0.0,"check:dependency_updates":0.0,"check:signed_commits":0.0,"check:lockfiles":1.0,"signed_commit_share":0.0174,"unpinned_manifests":0.0},"findings":[],"evidence":[],"data":{},"error":null},{"analyzer":"sec-distribution","pillar":"security","status":"ok","tool_version":null,"metrics":{"signals":0.0,"binary_assets":0.0,"suspicious":0.0},"findings":[],"evidence":[],"data":{"signals":[],"suspicious":false,"unusual_traction":false,"metadata":true},"error":null},{"analyzer":"qual-complexity","pillar":"quality","status":"ok","tool_version":"lizard 1.25.1","metrics":{"functions":495.0,"function_nloc":4563.0,"mean_ccn":3.88,"p90_ccn":8.0,"complex_functions":2.0,"long_functions":0.0,"many_param_functions":1.0,"risky_nloc_share":0.0145},"findings":[],"evidence":[{"kind":"complex-function","description":"match in Target Offer/正则表达式匹配.py: complexity 21, 27 lines","ref":"Target Offer/正则表达式匹配.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/正则表达式匹配.py#L11","weight":0.35},{"kind":"complex-function","description":"smoSimple in SVM/SVM.py: complexity 16, 39 lines","ref":"SVM/SVM.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/SVM/SVM.py#L26","weight":0.26666666666666666}],"data":{},"error":null},{"analyzer":"qual-duplication","pillar":"quality","status":"ok","tool_version":"repotrust-dup-w6","metrics":{"compared_lines":6534.0,"duplicated_lines":1097.0,"duplicated_share":0.1679,"files":152.0},"findings":[],"evidence":[{"kind":"duplicate-code","description":"6+ duplicated lines: AVL.py:1 and BinarySearchTree.py:1","ref":"AVL.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/AVL.py#L1","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: AwesomeAlgorithms/KMP算法.py:34 and AwesomeAlgorithms/KMP算法.py:49","ref":"AwesomeAlgorithms/KMP算法.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/AwesomeAlgorithms/KMP算法.py#L34","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/multiSparse.py:6 and Target Offer/transSparseMatrix.py:8","ref":"Target Offer/multiSparse.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/multiSparse.py#L6","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/两个链表的第一个公共结点.py:5 and Target Offer/删除链表中重复的结点.py:7","ref":"Target Offer/两个链表的第一个公共结点.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/两个链表的第一个公共结点.py#L5","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/二叉搜索树与双向链表.py:6 and Target Offer/二叉搜索树的最低公共祖先.py:5","ref":"Target Offer/二叉搜索树与双向链表.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/二叉搜索树与双向链表.py#L6","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/二叉搜索树的第k个结点.py:38 and leetcode/230. Kth Smallest Element in a BST.py:13","ref":"Target Offer/二叉搜索树的第k个结点.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/二叉搜索树的第k个结点.py#L38","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/二叉树中和为某一值的路径.py:14 and leetcode/113. Path Sum II.py:30","ref":"Target Offer/二叉树中和为某一值的路径.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/二叉树中和为某一值的路径.py#L14","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/从上往下打印二叉树.py:31 and Target Offer/按之字形顺序打印二叉树.py:59","ref":"Target Offer/从上往下打印二叉树.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/从上往下打印二叉树.py#L31","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/八皇后问题.py:14 and Target Offer/正方体对面和相同.py:11","ref":"Target Offer/八皇后问题.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/八皇后问题.py#L14","weight":0.3},{"kind":"duplicate-code","description":"6+ duplicated lines: Target Offer/判断平衡二叉树.py:42 and Target Offer/树的宽度.py:38","ref":"Target Offer/判断平衡二叉树.py","url":"https://github.com/Jack-Lee-Hiter/AlgorithmsByPython/blob/78d7ac4d93db9da40601a5567350bfb3e97e7d46/Target Offer/判断平衡二叉树.py#L42","weight":0.3}],"data":{},"error":null},{"analyzer":"qual-lint","pillar":"quality","status":"ok","tool_version":"opengrep 1.33.1; rules f1d2b562b414","metrics":{"findings":14.0,"weighted_findings":22.0,"scanned_lines":7729.0,"category:best-practice":12.0,"category:maintainability":2.0},"findings":[{"rule_id":"opengrep/python.lang.best-practice.open-never-closed","severity":"high","message":"file object opened without corresponding close","path":"Logistic regression/Logistic.py","line":6,"fingerprint":"python.lang.best-practice.open-never-closed:Logistic regression/Logistic.py:6"},{"rule_id":"opengrep/python.lang.best-practice.open-never-closed","severity":"high","message":"file object opened without corresponding close","path":"Logistic regression/Logistic.py","line":82,"fingerprint":"python.lang.best-practice.open-never-closed:Logistic regression/Logistic.py:82"},{"rule_id":"opengrep/python.lang.best-practice.open-never-closed","severity":"high","message":"file object opened without corresponding close","path":"Logistic regression/Logistic.py","line":83,"fingerprint":"python.lang.best-practice.open-never-closed:Logistic regression/Logistic.py:83"},{"rule_id":"opengrep/python.lang.best-practice.open-never-closed","severity":"high","message":"file object opened without corresponding close","path":"SVM/SVM.py","line":5,"fingerprint":"python.lang.best-practice.open-never-closed:SVM/SVM.py:5"},{"rule_id":"opengrep/python.lang.maintainability.useless-if-body","severity":"medium","message":"Useless if statement; both blocks have the same body","path":"AVL.py","line":119,"fingerprint":"python.lang.maintainability.useless-if-body:AVL.py:119"},{"rule_id":"opengrep/python.lang.best-practice.unspecified-open-encoding","severity":"medium","message":"Missing 'encoding' parameter. 'open()' uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding=\"utf-8\").","path":"Logistic regression/Logistic.py","line":6,"fingerprint":"python.lang.best-practice.unspecified-open-encoding:Logistic regression/Logistic.py:6"},{"rule_id":"opengrep/python.lang.best-practice.unspecified-open-encoding","severity":"medium","message":"Missing 'encoding' parameter. 'open()' uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding=\"utf-8\").","path":"Logistic regression/Logistic.py","line":82,"fingerprint":"python.lang.best-practice.unspecified-open-encoding:Logistic regression/Logistic.py:82"},{"rule_id":"opengrep/python.lang.best-practice.unspecified-open-encoding","severity":"medium","message":"Missing 'encoding' parameter. 'open()' uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding=\"utf-8\").","path":"Logistic regression/Logistic.py","line":83,"fingerprint":"python.lang.best-practice.unspecified-open-encoding:Logistic regression/Logistic.py:83"},{"rule_id":"opengrep/python.lang.maintainability.return-not-in-function","severity":"medium","message":"`return` only makes sense inside a function","path":"QuickSort.py","line":46,"fingerprint":"python.lang.maintainability.return-not-in-function:QuickSort.py:46"},{"rule_id":"opengrep/python.lang.best-practice.unspecified-open-encoding","severity":"medium","message":"Missing 'encoding' parameter. 'open()' uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding=\"utf-8\").","path":"SVM/SVM.py","line":5,"fingerprint":"python.lang.best-practice.unspecified-open-encoding:SVM/SVM.py:5"},{"rule_id":"opengrep/python.requests.best-practice.use-raise-for-status","severity":"medium","message":"There's an HTTP request made with requests, but the raise_for_status() utility method isn't used. This can result in request errors going unnoticed and your code behaving in unexpected ways, such as if your authorization API returns a 500 error while you're only checking for a 401.","path":"regularExpression/re练习.py","line":12,"fingerprint":"python.requests.best-practice.use-raise-for-status:regularExpression/re练习.py:12"},{"rule_id":"opengrep/python.requests.best-practice.use-timeout","severity":"medium","message":"Detected a 'requests' call without a timeout set. By default, 'requests' calls wait until the connection is closed. This means a 'requests' call without a timeout will hang the program if a response is never received. Consider setting a timeout for all 'requests'.","path":"regularExpression/re练习.py","line":12,"fingerprint":"python.requests.best-practice.use-timeout:regularExpression/re练习.py:12"},{"rule_id":"opengrep/python.requests.best-practice.use-raise-for-status","severity":"medium","message":"There's an HTTP request made with requests, but the raise_for_status() utility method isn't used. This can result in request errors going unnoticed and your code behaving in unexpected ways, such as if your authorization API returns a 500 error while you're only checking for a 401.","path":"regularExpression/re练习.py","line":35,"fingerprint":"python.requests.best-practice.use-raise-for-status:regularExpression/re练习.py:35"},{"rule_id":"opengrep/python.requests.best-practice.use-timeout","severity":"medium","message":"Detected a 'requests' call without a timeout set. By default, 'requests' calls wait until the connection is closed. This means a 'requests' call without a timeout will hang the program if a response is never received. Consider setting a timeout for all 'requests'.","path":"regularExpression/re练习.py","line":35,"fingerprint":"python.requests.best-practice.use-timeout:regularExpression/re练习.py:35"}],"evidence":[],"data":{},"error":null},{"analyzer":"qual-testing","pillar":"quality","status":"ok","tool_version":null,"metrics":{"check:has_tests":0.0,"check:test_ratio":0.0,"check:ci_present":0.0,"check:ci_runs_tests":0.0,"check:ci_runs_lint":0.0,"check:tests_cochange":0.0,"test_lines":0.0,"source_lines":7729.0,"test_ratio":0.0,"ci_files":0.0,"cochange_share":0.0,"cochange_commits":46.0},"findings":[],"evidence":[],"data":{"test_commands":[],"lint_commands":[]},"error":null},{"analyzer":"qual-docs","pillar":"quality","status":"ok","tool_version":null,"metrics":{"check:readme":1.0,"check:license":0.0,"check:contributing":0.0,"check:changelog":0.0,"readme_lines":121.0},"findings":[],"evidence":[{"kind":"docs","description":"README.md","ref":"README.md","url":null,"weight":0.0}],"data":{},"error":null},{"analyzer":"qual-type-safety","pillar":"quality","status":"ok","tool_version":null,"metrics":{"check:strict_config":0.0,"check:low_escape_density":1.0,"escapes":0.0,"escapes_per_kloc":0.0},"findings":[],"evidence":[],"data":{},"error":null}],"flags":[]}