Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goodpractice checks #3

Closed
goldingn opened this issue Aug 1, 2018 · 1 comment
Closed

goodpractice checks #3

goldingn opened this issue Aug 1, 2018 · 1 comment

Comments

@goldingn
Copy link

goldingn commented Aug 1, 2018

I used the goodpractice package to run some automated code checks of sdmbench. Below are some super minor style/robustness issues it flagged that you could change if you wanted to.

On two lines (here and here) you used = for assignment, instead of <- which you used everywhere else.

On quite a few lines of the shiny server file there are more than 80 characters per line, which makes it a bit difficult to read (particularly here). It would be worth reformatting that code to have shorter lines

On this line of the shiny server, you used the code pattern: 1:length(x), but seq_along(x) is (very mildly) preferable (in general), since in the case x has length 0 (e.g. an empty list), 1:length(x) returns c(1L, 0L), but seq_along returns integer(0).

That's all it found though, and these are very minor, which is great! I run those checks on packages quite regularly, and the reports are rarely as short as that.

@boyanangelov
Copy link
Owner

I implemented the changes, hope the code is more readable now. Thanks a lot for letting me know about the goodpractice package - I will have a look and start using it. I changed the code pattern as well, I didn't know it worked this way, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants