Skip to content

Commit

Permalink
Merge pull request #2476 from crytic/fixups
Browse files Browse the repository at this point in the history
fix ordering and dead-code detector
  • Loading branch information
0xalpharush authored Jun 5, 2024
2 parents 353d4da + 2e6508f commit 798c1f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion slither/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def choose_detectors(
set(detectors_to_run), args.detectors_to_include, detectors
)

detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT)
return detectors_to_run


Expand All @@ -255,7 +256,6 @@ def __include_detectors(
else:
raise ValueError(f"Error: {detector} is not a detector")

detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT)
return detectors_to_run


Expand Down
3 changes: 2 additions & 1 deletion slither/detectors/functions/dead_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ def _detect(self) -> List[Output]:
continue
if isinstance(function, FunctionContract) and (
function.contract_declarer.is_from_dependency()
or function.contract_declarer.is_library
):
continue
# Continue if the functon is not implemented because it means the contract is abstract
# Continue if the function is not implemented because it means the contract is abstract
if not function.is_implemented:
continue
info: DETECTOR_INFO = [function, " is never used and should be removed\n"]
Expand Down

0 comments on commit 798c1f6

Please sign in to comment.