24
matwx
5y

I'm task to amend the code smell in the project. I literally can cry a river.
I see such thing as i = i++; - It's flag out as a bug.

I have also seen check in classes. With un-used variables. I literally cried.

In the past, i ask why do i got to care about code quality. I actually start to get angry like the team leads in my project.

Comments
  • 4
    I know the feels. I see gems like this in the project in my office. :/
  • 0
    I hope are not going through the files manually. That would be a nightmare.😨😨😨😨.
    If so, you can integrate your project with an appropriate code quality tool.
    I know it can be a pain to rectify all the code smells at once but if you integrate your project with a tool, it will automatically generate the smells and other stuffs like coverage report, vulnerabilities etc. Then the dev who actually gave the pr will be responsible for correcting it before his code gets merged 😏😏. So less work for you. You won't have to rectify any new code smells.
  • 0
    @TheUchihaGirl can you tell me more about what kind of code quality tools you know please?
  • 0
    Actually, those unused variables are used for debug purposes. If anything goes wrong, these variables can tell what is happening. It may be a good idea to see what they are used for, before mindlessly deleting them.

    Also, get a linter do the task for you.
  • 0
    @AvyChanna Debugging variables in main class you sure? Then what is junit test for?
  • 0
    @matwx Hey, I'm just guessing. How would I know what they are used for?
    Also, not everyone knows Junit , maybe the dev before you wrote it like this. I had to work with such a class. It had a DEBUG Boolean and all the functions were riddled with if else conditions for debug. The dev would manually toggle debug to true during testing and reset it to false in prod.
  • 0
    @AvyChanna We had junit in place. Therefore is not acceptable in the project environment.
Add Comment