Osu: Issues found by PVS-Studio

Created on 13 Jan 2020  Â·  3Comments  Â·  Source: ppy/osu

Hello,
I have found a few bugs using PVS-Studio analyzer.
PVS-Studio is a static code analyzer for C, C++, C#, and Java.
I gave the description of errors and code fragments in the article.
You can read the article at the official site: https://www.viva64.com/en/b/0704/

Most helpful comment

@skhrenov on looking through the article, at least one of the issues you pointed out is not a bug at our end, but seems to be a failure in your static analysis (the UpdateResult one). You don't have comments turned on on your blog which makes it hard to provide feedback.

Also I'd be hesitant to call the majority of the issues you found "bugs". Many are code quality issues – that's for sure – but by definition, bugs need to actually have an effect at runtime:

A software bug is an error, flaw or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.

Duplicate conditional for instance can therefore not be called bugs. They are also not from "copy paste coding" but likely from large code base refactors where certain values have been removed over the years.

All 3 comments

I think splitting this issue into multiple ones would be a better idea, rather than simply linking an article as an act of advertisement.

There are so many inaccuracies and assumptions in that article, I'm wary of its validity.

If you have specific problems with the codebase that you think could be improved, please raise an issue for each one and/or make a pull request.

We value all improvements to the codebase, but a single catch-all issue is not really helpful for us.

@skhrenov on looking through the article, at least one of the issues you pointed out is not a bug at our end, but seems to be a failure in your static analysis (the UpdateResult one). You don't have comments turned on on your blog which makes it hard to provide feedback.

Also I'd be hesitant to call the majority of the issues you found "bugs". Many are code quality issues – that's for sure – but by definition, bugs need to actually have an effect at runtime:

A software bug is an error, flaw or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.

Duplicate conditional for instance can therefore not be called bugs. They are also not from "copy paste coding" but likely from large code base refactors where certain values have been removed over the years.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Joehuu picture Joehuu  Â·  3Comments

smileyhead picture smileyhead  Â·  3Comments

LevKatenin picture LevKatenin  Â·  3Comments

smileyhead picture smileyhead  Â·  3Comments

Axeanz picture Axeanz  Â·  3Comments