Skip to content

Commit

Permalink
feat: add solhint
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan-deepsource committed Dec 22, 2023
1 parent 2451a07 commit 04a60d8
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 77 deletions.
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1001.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "minor"
category = "antipattern"
weight = 40
description = """
Function has cyclomatic complexity "current" but allowed no more than maxcompl.
Function has cyclomatic complexity `current` but allowed no more than maxcompl.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1004.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "minor"
category = "antipattern"
weight = 40
description = """
Function body contains "count" lines but allowed no more than maxlines.
Function body contains `count` lines but allowed no more than maxlines.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1006.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "minor"
category = "antipattern"
weight = 40
description = """
Contract has "some count" states declarations but allowed no more than maxstates.
Contract has `some count` states declarations but allowed no more than maxstates.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1011.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "minor"
category = "antipattern"
weight = 40
description = """
Variable "name" is unused.
Variable `name` is unused.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1036.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
Avoid to use ".call.value()()".
Avoid to use `.call.value()()`.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1038.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
Use "keccak256" instead of deprecated "sha3".
Use `keccak256` instead of deprecated `sha3`.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1039.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
Use "selfdestruct" instead of deprecated "suicide".
Use `selfdestruct` instead of deprecated `suicide`.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1040.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
"throw" is deprecated, avoid to use it.
`throw` is deprecated, avoid to use it.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1042.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
Check result of "send" call.
Check result of `send` call.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1046.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
Avoid multiple calls of "send" method in single transaction.
Avoid multiple calls of `send` method in single transaction.
<!--more-->
Expand Down
2 changes: 1 addition & 1 deletion analyzers/solhint/.deepsource/issues/SOLHINT-W1049.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ severity = "major"
category = "security"
weight = 60
description = """
Do not rely on "block.blockhash". Miners can influence its value.
Do not rely on `block.blockhash`. Miners can influence its value.
<!--more-->
Expand Down
4 changes: 2 additions & 2 deletions analyzers/solhint/utils/issue_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ def update_issue_tomls() -> None:

filepath = _get_toml_path(issue_code)

title = rule.description.removesuffix(".").replace('"', "`")
title = rule.description.replace('"', "`").removesuffix(".")
wiki_url = rule.wiki_url
description = rule.description
description = rule.description.replace('"', "`")
bad_practice = "\n\n".join(
(
f"{idx}. {bad_example['description']}\n"
Expand Down
4 changes: 2 additions & 2 deletions analyzers/solhint/utils/issue_map_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def get_mapping() -> Dict[str, Dict[str, str]]:
rules = get_all_rules()

if len(rules) > len(issue_map):
# if the no. of issues in the mapping is less than the no. of detectors,
# then generate the mapping only for the new detectors
# if the no. of issues in the mapping is less than the no. of rules,
# then generate the mapping only for the new rules
for rule in rules:
if rule.rule_id not in issue_map:
next_code = next(generate_code)
Expand Down
Loading

0 comments on commit 04a60d8

Please sign in to comment.