Skip to content

Addressing SonarCloud suggestions #603

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

Merged
merged 18 commits into from
Nov 5, 2021

Conversation

akornich
Copy link
Contributor

@akornich akornich commented Nov 4, 2021

Description of the change

Addressing SonarCloud suggestions

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

n/a

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@akornich akornich added refactoring Denotes codebase refactoring task chore labels Nov 4, 2021
@akornich akornich self-assigned this Nov 4, 2021
Copy link

@waltjones waltjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of comments throughout the code, where 'TODO' has been stripped from the comment, but there's no apparent related code change. I don't know how to interpret these. Did the TODO get implemented in these cases?

Related to that, the Dispose pattern that is implemented several times in the code seems to have a mismatch in meaning between the comments and the code. It was also odd to see a lint error suppression ("S1066:Collapsible "if" statements should be merged") in only one of those cases, and none of the others. Is that lint suppression really needed?

// TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
// TODO: set large fields to null.
// free unmanaged resources (unmanaged objects) and override a finalizer below.
// set large fields to null.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as above. Is this supposed to be a TODO, or is the thing in the comment already implemented now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was already addressed by my comment/reply above...

@akornich
Copy link
Contributor Author

akornich commented Nov 5, 2021

There are a lot of comments throughout the code, where 'TODO' has been stripped from the comment, but there's no apparent related code change. I don't know how to interpret these. Did the TODO get implemented in these cases?

Related to that, the Dispose pattern that is implemented several times in the code seems to have a mismatch in meaning between the comments and the code. It was also odd to see a lint error suppression ("S1066:Collapsible "if" statements should be merged") in only one of those cases, and none of the others. Is that lint suppression really needed?

@waltjones , I addressed all of it in the other code-spot-specific comments that you made. Let me know if I missed anything...

@waltjones
Copy link

@akornich Thanks for the follow up. The changes in the TODO comments look like something that will come back to haunt later. The resulting comments seem misleading.

@akornich
Copy link
Contributor Author

akornich commented Nov 5, 2021

@akornich Thanks for the follow up. The changes in the TODO comments look like something that will come back to haunt later. The resulting comments seem misleading.

@waltjones, what do you mean by "haunt later"? These are modified code comments that still have the same directions to follow when/if applicable but do not disturb the SonarrCloud analyzer long-term if never needed to implement in each specific case.

Also, what is exactly so misleading about?:

// free unmanaged resources (unmanaged objects) and override a finalizer below.
OR
// set large fields to null.

If a class does not use unmanaged resources, there is nothing to free following the first direction.
OR
If a class does not have any large data fields - no need to set them to null. However, if later on, the class adds the use of a large field, the comment serves as a reminder/direction to set the new field to null.

@waltjones
Copy link

If the comments don't apply to the code, they should be removed completely. If they are a todo that should be implemented later, they should say that clearly in some way.

Maybe send the diff to some other people and see what feedback you get.

@akornich
Copy link
Contributor Author

akornich commented Nov 5, 2021

@waltjones , thanks again for the diligent review!

@akornich akornich merged commit fd92f35 into rollbar:master Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore refactoring Denotes codebase refactoring task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants