dougshidong / PHiLiP

Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
Other
46 stars 37 forks source link

Clean up explicit and default construct destructor #243

Closed dougshidong closed 1 year ago

dougshidong commented 1 year ago

Remove unnecessary empty constructors (those exist by default). 

Remove unnecessary empty and destructors (those exist by default). https://sonarcloud.io/organizations/dougshidong/rules?open=cpp%3AS4963&rule_key=cpp%3AS4963

The abstract classes which have a virtual destructor must have an implementation (usually = default). https://sonarcloud.io/organizations/dougshidong/rules?languages=cpp&open=cpp%3AS1235&q=destructor+virtu

Use default in case the constructor or destructor is absolutely necessary instead of Foo::Foo() {};

Declare constructors with explicit keyword. https://sonarcloud.io/organizations/dougshidong/rules?open=cpp%3AS1709&rule_key=cpp%3AS1709

dougshidong commented 1 year ago

For some reason the diff shows commits previously merged in https://github.com/dougshidong/PHiLiP/pull/241. The diff is really just the last 2 commits. The tab Files Changed is accurate.

dougshidong commented 1 year ago

Thanks for another cleanup PR! I don't have many comments since the changes are all very similar.

There are several tests which take only a parameters pointer as input to the constructor. Should those also use explicit?

Good catch. I have SonarLint detecting all the errors I had fixed locally. However, it's not including the testing directory in the global analysis, only when I'm running it on the specific file. Looking into why all the testing files have been missed by the local analysis. The web analysis seems to have caught them all.

dougshidong commented 1 year ago

Alright, found all them. No idea why my local SonarLint exclude files from analysis. Asked in their forums. @cpethrick , could you review/approve?

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication