-
Notifications
You must be signed in to change notification settings - Fork 392
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 WindowManager #10836
base: develop
Are you sure you want to change the base?
CppCheck WindowManager #10836
Conversation
BranchInputManager::GetBranchFanTypeName(state, BranchNum, FanType, FanName, ErrFound); | ||
if (!ErrFound) { | ||
BranchFanFlow = state.dataFans->fans(this->m_FanIndex)->maxAirFlowRate; | ||
} |
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.
[src/EnergyPlus/UnitarySystem.cc:2986]:(style),[variableScope],The scope of the variable 'FanType' can be reduced.
[src/EnergyPlus/UnitarySystem.cc:2987]:(style),[variableScope],The scope of the variable 'm_FanName' can be reduced.
if (this->m_DesignSpecMSHPIndex == -1) { | ||
std::string MultispeedType = "Fan:SystemModel"; | ||
} | ||
std::string MultispeedType = (this->m_DesignSpecMSHPIndex == -1) ? "Fan:SystemModel" : "UnitarySystemPerformance:Multispeed"; |
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.
[src/EnergyPlus/UnitarySystem.cc:6667]:(style),[variableScope],The scope of the variable 'MultispeedType' can be reduced.
[src/EnergyPlus/UnitarySystem.cc:6669]:(style),[shadowVariable],Local variable 'MultispeedType' shadows outer variable
[src/EnergyPlus/UnitarySystem.cc:6669]:(style),[unreadVariable],Variable 'MultispeedType' is assigned a value that is never used.
if (this->m_DesignSpecMSHPIndex == -1) { | ||
std::string MultispeedType = "Fan:SystemModel"; | ||
} | ||
std::string MultispeedType = (this->m_DesignSpecMSHPIndex == -1) ? "Fan:SystemModel" : "UnitarySystemPerformance:Multispeed"; |
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.
[src/EnergyPlus/UnitarySystem.cc:6621]:(style),[variableScope],The scope of the variable 'MultispeedType' can be reduced.
[src/EnergyPlus/UnitarySystem.cc:6623]:(style),[shadowVariable],Local variable 'MultispeedType' shadows outer variable
[src/EnergyPlus/UnitarySystem.cc:6623]:(style),[unreadVariable],Variable 'MultispeedType' is assigned a value that is never used.
@@ -114,7 +114,6 @@ namespace UserDefinedComponents { | |||
|
|||
void UserPlantComponentStruct::onInitLoopEquip(EnergyPlusData &state, const PlantLocation &calledFromLocation) | |||
{ | |||
bool anyEMSRan; |
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.
[src/EnergyPlus/UserDefinedComponents.cc:117]:(style),[variableScope],The scope of the variable 'anyEMSRan' can be reduced.
@@ -489,7 +476,8 @@ void CalcCoPlanarNess(Array1D<Vector> &Surf, int const NSides, bool &IsCoPlanar, | |||
if (std::abs(MaxDist) > Constant::SmallDistance) IsCoPlanar = false; | |||
} | |||
|
|||
std::vector<int> PointsInPlane(Array1D<Vector> &BaseSurf, int const BaseSides, Array1D<Vector> &QuerySurf, int const QuerySides, bool &ErrorFound) | |||
std::vector<int> | |||
PointsInPlane(Array1D<Vector> &BaseSurf, int const BaseSides, Array1D<Vector> const &QuerySurf, int const QuerySides, bool &ErrorFound) |
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.
[src/EnergyPlus/Vectors.cc:492]:(style),[constParameterReference],Parameter 'QuerySurf' can be declared as reference to const
int Loop; // loop counter | ||
Real64 QToCoolSetPt; // sensible load to cooling setpoint (W) | ||
Real64 NoCompOutput; // sensible load delivered with compressor off (W) | ||
|
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.
[src/EnergyPlus/WindowAC.cc:735]:(style),[variableScope],The scope of the variable 'InNode' can be reduced.
[src/EnergyPlus/WindowAC.cc:736]:(style),[variableScope],The scope of the variable 'OutNode' can be reduced.
[src/EnergyPlus/WindowAC.cc:741]:(style),[variableScope],The scope of the variable 'Loop' can be reduced.
MaxAirVolFlowDes = 0.0; | ||
MaxAirVolFlowUser = 0.0; | ||
OutAirVolFlowDes = 0.0; | ||
OutAirVolFlowUser = 0.0; |
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.
[src/EnergyPlus/WindowAC.cc:912]:(style),[variableScope],The scope of the variable 'SizingString' can be reduced.
[src/EnergyPlus/WindowAC.cc:914]:(style),[variableScope],The scope of the variable 'FieldNum' can be reduced.
[src/EnergyPlus/WindowAC.cc:915]:(style),[variableScope],The scope of the variable 'SizingMethod' can be reduced.
[src/EnergyPlus/WindowAC.cc:917]:(style),[variableScope],The scope of the variable 'PrintFlag' can be reduced.
[src/EnergyPlus/WindowAC.cc:918]:(style),[variableScope],The scope of the variable 'zoneHVACIndex' can be reduced.
[src/EnergyPlus/WindowAC.cc:919]:(style),[variableScope],The scope of the variable 'SAFMethod' can be reduced.
[src/EnergyPlus/WindowAC.cc:921]:(style),[variableScope],The scope of the variable 'CapSizingMethod' can be reduced.
[src/EnergyPlus/WindowAC.cc:924]:(style),[unreadVariable],Variable 'IsAutoSize' is assigned a value that is never used.
@@ -1925,7 +1923,7 @@ namespace Window { | |||
return num / denom; // dangerous, doesn't check for zero denominator | |||
} | |||
|
|||
Real64 visibleSpectrumAverage(EnergyPlusData &state, gsl::span<Real64 const> p) | |||
Real64 visibleSpectrumAverage(EnergyPlusData const &state, gsl::span<Real64 const> p) |
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.
[src/EnergyPlus/WindowManager.cc:1928]:(style),[constParameterReference],Parameter 'state' can be declared as reference to const
@@ -4534,7 +4515,7 @@ namespace Window { | |||
fcon[i - 1] = wmgas.con.c0 + wmgas.con.c1 * tmean + wmgas.con.c2 * tmean_2; | |||
fvis[i - 1] = wmgas.vis.c0 + wmgas.vis.c1 * tmean + wmgas.vis.c2 * tmean_2; | |||
fcp[i - 1] = wmgas.cp.c0 + wmgas.cp.c1 * tmean + wmgas.cp.c2 * tmean_2; | |||
fdens[i - 1] = pres * wmgas.wght / (gaslaw * tmean); | |||
// fdens[i - 1] = pres * wmgas.wght / (gaslaw * tmean); |
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.
[src/EnergyPlus/WindowManager.cc:4537]:(style),[unreadVariable],Variable 'fdens[i-1]' is assigned a value that is never used.
@@ -4591,7 +4572,7 @@ namespace Window { | |||
|
|||
//****************************************************************************** | |||
|
|||
void WindowGasPropertiesAtTemp(EnergyPlusData &state, | |||
void WindowGasPropertiesAtTemp(EnergyPlusData const &state, |
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.
[src/EnergyPlus/WindowManager.cc:4594]:(style),[constParameterReference],Parameter 'state' can be declared as reference to const
|
@Myoldmopar can you confirm the RelWithDebugInfo failure? The RelWithDebugInfo build runs on Windows. |
Pull request overview
NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.