Skip to content

Commit

Permalink
[IMP] cleans up code and removes all unused or unimportant files
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraschauer committed Aug 30, 2024
1 parent b56718c commit aa8d2fe
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 340 deletions.
8 changes: 3 additions & 5 deletions prospector/evaluation/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def analyse_prospector_reports(filename: str, selected_cves: str):
# Keep track of the CVEs where there is no report file
reports_not_found = []

#### Data to insert into table
# Data to insert into table
if BATCH in ["regular", "old_code"]:
results = {
"high": [],
Expand Down Expand Up @@ -620,7 +620,7 @@ def generate_checkmarks_table(input_dataset: str, selected_cves):

rule_checks = {rule: "" for rule in all_rules}
for r in matched_rules:
rule_checks[r] = "\checkmark"
rule_checks[r] = "\checkmark" # noqa: W605

Check failure on line 623 in prospector/evaluation/analyse.py

View workflow job for this annotation

GitHub Actions / build

at least two spaces before inline comment

row.extend([rule_checks[r] for r in all_rules])
row.extend([str(overall_exectime), str(llm_exectime)])
Expand Down Expand Up @@ -785,9 +785,7 @@ def generate_sankey_diagram(file1: str, file2: str, file3: str):
height=800,
)

output_file = (
ANALYSIS_RESULTS_PATH + f"sankey-{file1}-{file2}-{file3}.png"
)
output_file = ANALYSIS_RESULTS_PATH + f"sankey-{file1}-{file2}-{file3}.png"
# Save as PNG
write_image(fig, output_file)
print(f"Sankey diagram saved to {output_file}")
10 changes: 0 additions & 10 deletions prospector/evaluation/analyse_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ def analyse_statistics(filename: str): # noqa: C901
avg_cc_time = sum(cc_times) / len(cc_times)
avg_total_cc_time = sum(total_cc_times) / len(total_cc_times)

# How many commits was the commit classification rule applied to?
for itm in dataset:
filepath = PROSPECTOR_REPORTS_PATH_HOST + filename + f"/{itm[0]}.json"
try:
cc_num_commits = _get_cc_num_commits(filepath)
break

except FileNotFoundError:
continue

execution_data = {
"timestamp": datetime.now().strftime("%H:%M:%S"),
"total_files_found": len(repo_times),
Expand Down
2 changes: 1 addition & 1 deletion prospector/evaluation/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def main():
file = "evaluation/data/input/d63.csv"
dataset = load_dataset(file)

## Things to measure
# Things to measure
counterpart_exists = []
missing_in_directory1 = []
missing_in_directory2 = []
Expand Down
133 changes: 0 additions & 133 deletions prospector/evaluation/compare_reports.py

This file was deleted.

160 changes: 0 additions & 160 deletions prospector/evaluation/create_jobs.py

This file was deleted.

2 changes: 1 addition & 1 deletion prospector/evaluation/dispatch_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _run_prospector_and_generate_report(
logger.error(f"prospector() crashed at {cve_id}: {e}")
raise e

logger.info(f"prospector() returned. Generating report now.")
logger.info("prospector() returned. Generating report now.")

try:
generate_report(
Expand Down
26 changes: 0 additions & 26 deletions prospector/evaluation/extract_errors.py

This file was deleted.

Loading

0 comments on commit aa8d2fe

Please sign in to comment.