-
Notifications
You must be signed in to change notification settings - Fork 193
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
Cppcheck 2.15 #5282
Cppcheck 2.15 #5282
Conversation
…on/ruby engines etc
…ocumentation purposes
…s a vector, the Surface/SubSurface return an optional The PlanarSurface should be changed or removed.
-i src/cli/test/ \ | ||
-i src/airflow/contam/ \ | ||
-i src/polypartition/ \ | ||
-i src/nano/ \ | ||
. \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This effectively adds the root directories "python" and "ruby" to cppcheck
@@ -100,7 +100,7 @@ namespace alfalfa { | |||
/** | |||
* Get a vector of all points currently exported to the Alfalfa API | |||
*/ | |||
std::vector<AlfalfaPoint> points(); | |||
std::vector<AlfalfaPoint> points() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cppcheck 2.13 already complains about this one on develop right now
@@ -48,7 +48,7 @@ namespace model { | |||
/** @name Constructors and Destructors */ | |||
//@{ | |||
|
|||
virtual ~Building() = default; | |||
virtual ~Building() override = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lots of this.
@@ -48,22 +48,16 @@ namespace model { | |||
/** @name Getters */ | |||
//@{ | |||
|
|||
std::string controlVariable() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of duplInheritedMembers
fixes
src/model/StraightComponent.hpp
Outdated
* | ||
* Reimplemented from HVACComponent. | ||
*/ | ||
boost::optional<AirLoopHVAC> airLoopHVAC() const; // cppcheck-suppress [duplInheritedMember] for documentation purposes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some I keep, for documentation purposes mostly, because the docstring is helpful versus the base class one.
@@ -95,7 +95,7 @@ void Surface3dEdge::resetEdgeMatching() { | |||
m_conflictedOrientation = false; | |||
} | |||
|
|||
bool Surface3dEdge::containsPoint(const Point3d& testVertex) { | |||
bool Surface3dEdge::containsPoint(const Point3d& testVertex) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const correctness
@@ -396,7 +396,7 @@ std::vector<Surface3dEdge> Polyhedron::edgesNotTwo(bool includeCreatedEdges) con | |||
} | |||
} | |||
} | |||
for (auto& edge : edgesNotTwo) { | |||
for (const auto& edge : edgesNotTwo) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const correctness
@@ -184,7 +184,7 @@ std::ostream& IddFieldProperties::print(std::ostream& os) const { | |||
os << " \\reference " << reference << '\n'; | |||
} | |||
} | |||
if (!references.empty()) { | |||
if (!referenceClassNames.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a mistake to begin with (copy paste)
string propertiesText; | ||
if (boost::regex_search(text, matches, iddRegex::line())) { | ||
objectName = string(matches[1].first, matches[1].second); | ||
std::string objectName = string(matches[1].first, matches[1].second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reducing scope
// cppcheck-suppress [duplInheritedMember] because PlanarSurface is dumb and returns a vector | ||
boost::optional<SurfacePropertyConvectionCoefficients> surfacePropertyConvectionCoefficients() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to break API, but this is clearly wrong.
This is wrong:
OpenStudio/src/model/PlanarSurface.hpp
Lines 199 to 200 in 62f977e
/// Returns any SurfacePropertyConvectionCoefficients associated with this surface, does not return SurfacePropertyConvectionCoefficientsMultipleSurface. | |
std::vector<SurfacePropertyConvectionCoefficients> surfacePropertyConvectionCoefficients() const; |
CI Results for 21d7036:
|
#include "ruby.h" | ||
#include "./RubyException.hpp" | ||
#include <ruby.h> | ||
#include "RubyException.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curios , why are using relative path above but keeps the hpp name here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the question, could you rephrase please?
Pull request overview
Prompted by recent failures in our cppcheck workflow, use the latest version, and fix more issues that are being caught.
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.