You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mvankessel-EMC generated PaRe reports for all HADES packages and added links to the reports to the package status page. We should review these reports and identify places where refactoring is needed.
The text was updated successfully, but these errors were encountered:
It's too late for the HADES Hack-a-thon, but I thought it would be useful to show how I go through the PaRe reports. So here are some things I picked up for Achilles.
Achilles
Function diagram
Function diagram of Achilles
There are two functions that interact with a lot of other (internal) functions: achilles() and exportToJson(). These are the functions that carry out most of the work, and should probably be prioritized for unit-testing.
Function Definitions
Function
Number of arguments
Lines of code
Cyclomatic complexity
Location
achilles
24
505
96
Achilles.R (from line: 127)
achilles() could probably do with some refactoring. It has a lot of logic behind it, which theoretically requires 96 different unit tests to test all of the 505 lines of code. It also has bunch of arguments (24), which is not ideal, but provides an all-in-one way to interact with the package.
According to Codecov 2% of the code is covered. To meaningfully refactor anything unit-tests need to be made to to safeguard the current behavior.
Lintr
There are quite some code-style messages and warnings. Most of which boil down to:
local variable 'x' assigned but may not be used
1:nrow(...) is likely to be wrong in the empty edge case. Use seq_len(nrow(...)) instead.
Lines should not be more than 80 characters.
Commas should always have a space after.
Trailing whitespace is superfluous.
Dependencies
tseries is not whitelisted, but saw its last CRAN update on 2023-05-02. But is only used for one function: tseries::adf.test(). And is called once in isStationary()
data.table is used for one function: data.table::fwrite(), which is widely used in various functions in exportToAres.R.
readr is used for one function: readr::write_csv(). And is called once in exportResultsToCSV()
@mvankessel-EMC generated PaRe reports for all HADES packages and added links to the reports to the package status page. We should review these reports and identify places where refactoring is needed.
The text was updated successfully, but these errors were encountered: