Skip to content

Commit

Permalink
cli/reportgen
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Aug 2, 2024
1 parent 32afc47 commit 5fe0243
Show file tree
Hide file tree
Showing 5 changed files with 341 additions and 385 deletions.
6 changes: 1 addition & 5 deletions reports/adhoc-sol-files-highs-only-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
"yul-return",
"state-variable-shadowing",
"unchecked-send",
"misused-boolean",
"send-ether-no-checks",
"delegate-call-unchecked-address",
"tautological-compare",
Expand All @@ -195,10 +194,7 @@
"weak-randomness",
"pre-declared-local-variable-usage",
"delete-nested-mapping",
<<<<<<< HEAD
"boolean-equality"
=======
"boolean-equality",
"contract-locks-ether"
>>>>>>> dev
]
}
162 changes: 75 additions & 87 deletions reports/report.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"files_summary": {
<<<<<<< HEAD
"total_source_units": 68,
"total_sloc": 1931
=======
"total_source_units": 75,
"total_sloc": 2128
>>>>>>> dev
"total_source_units": 76,
"total_sloc": 2155
},
"files_details": {
"files_details": [
Expand Down Expand Up @@ -317,13 +312,8 @@
]
},
"issue_count": {
<<<<<<< HEAD
"high": 30,
"low": 23
=======
"high": 34,
"low": 25
>>>>>>> dev
"low": 26
},
"high_issues": {
"issues": [
Expand Down Expand Up @@ -1457,73 +1447,6 @@
}
]
},
{
"title": "Misused boolean with logical operators",
"description": "The patterns `if (… || true)` and `if (.. && false)` will always evaluate to true and false respectively.",
"detector_name": "misused-boolean",
"instances": [
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 12,
"src": "257:19",
"src_char": "257:19"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 19,
"src": "419:20",
"src_char": "419:20"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 26,
"src": "582:20",
"src_char": "582:20"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 33,
"src": "745:19",
"src_char": "745:19"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 40,
"src": "908:51",
"src_char": "908:51"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 47,
"src": "1060:52",
"src_char": "1060:52"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 54,
"src": "1213:53",
"src_char": "1213:53"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 61,
"src": "1366:21",
"src_char": "1366:21"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 68,
"src": "1530:17",
"src_char": "1530:17"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 75,
"src": "1691:18",
"src_char": "1691:18"
}
]
},
{
"title": "Sending native Eth is not protected from these functions.",
"description": "Introduce checks for `msg.sender` in the function",
Expand Down Expand Up @@ -1861,7 +1784,6 @@
]
},
{
<<<<<<< HEAD
"title": "Boolean equality is not required.",
"description": "If `x` is a boolean, there is no need to do `if(x == true)` or `if(x == false)`. Just use `if(x)` and `if(!x)` respectively.",
"detector_name": "boolean-equality",
Expand Down Expand Up @@ -1889,7 +1811,10 @@
"line_no": 26,
"src": "614:16",
"src_char": "614:16"
=======
}
]
},
{
"title": "Contract locks Ether without a withdraw function.",
"description": "It appears that the contract includes a payable function to accept Ether but lacks a corresponding function to withdraw it, which leads to the Ether being locked in the contract. To resolve this issue, please implement a public or external function that allows for the withdrawal of Ether from the contract.",
"detector_name": "contract-locks-ether",
Expand Down Expand Up @@ -1923,7 +1848,6 @@
"line_no": 58,
"src": "4547:15",
"src_char": "3059:15"
>>>>>>> dev
}
]
}
Expand Down Expand Up @@ -3910,6 +3834,73 @@
}
]
},
{
"title": "Misused boolean with logical operators",
"description": "The patterns `if (… || true)` and `if (.. && false)` will always evaluate to true and false respectively.",
"detector_name": "misused-boolean",
"instances": [
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 12,
"src": "257:19",
"src_char": "257:19"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 19,
"src": "419:20",
"src_char": "419:20"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 26,
"src": "582:20",
"src_char": "582:20"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 33,
"src": "745:19",
"src_char": "745:19"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 40,
"src": "908:51",
"src_char": "908:51"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 47,
"src": "1060:52",
"src_char": "1060:52"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 54,
"src": "1213:53",
"src_char": "1213:53"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 61,
"src": "1366:21",
"src_char": "1366:21"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 68,
"src": "1530:17",
"src_char": "1530:17"
},
{
"contract_path": "src/MisusedBoolean.sol",
"line_no": 75,
"src": "1691:18",
"src_char": "1691:18"
}
]
},
{
"title": "Redundant statements have no effect.",
"description": "Remove the redundant statements because no code will be generated and it just congests the codebase.",
Expand Down Expand Up @@ -4045,10 +4036,7 @@
"weak-randomness",
"pre-declared-local-variable-usage",
"delete-nested-mapping",
<<<<<<< HEAD
"boolean-equality"
=======
"boolean-equality",
"contract-locks-ether"
>>>>>>> dev
]
}
Loading

0 comments on commit 5fe0243

Please sign in to comment.