Skip to content
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

Fix cppcheck warnings #229

Merged
merged 21 commits into from
Sep 9, 2020
Merged

Fix cppcheck warnings #229

merged 21 commits into from
Sep 9, 2020

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Sep 7, 2020

Note: this includes #227

cppcheck is never going to get used properly unless we start throwing for everything (currently I only throw if there is an ERROR)

Current status before PR:

==========================================
             CPPCHECK Summary:
------------------------------------------
 * No error(s)
 * 24 warning(s)
 * 624 style(s)
 * 100 performance(s)
 * No portability(s)
 * 1 information(s)
 * No debug(s)
 * No none(s)
==========================================

Locally, at root of OpenStudioApplication:

reset && cppcheck --suppress=noExplicitConstructor --suppress=useStlAlgorithm --enable=all --inline-suppr --inconclusive --template='[{file}:{line}]:({severity}),[{id}],{message}' --force -q -j $(nproc) -i ./src/qtwinmigrate ./src/  &> cppcheck.txt && python ci/colorize_cppcheck_results.py

@jmarrec
Copy link
Collaborator Author

jmarrec commented Sep 8, 2020

Not sure what to do with these.

[src/model_editor/AccessPolicyStore.hpp:113]:(performance),[functionStatic],Technically the member function 'openstudio::model::AccessPolicyStore::loadFile' can be static (but you may consider moving to unnamed namespace).

[src/model_editor/Application.hpp:75]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::hasSetting' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:78]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::removeSetting' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:91]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:92]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:93]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:94]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).

@jmarrec
Copy link
Collaborator Author

jmarrec commented Sep 8, 2020

I fixed almost all style warnings as well, except the constParameter warnings and these few ones that are actually valid points.

[src/model_editor/ObjectExplorer.cpp:167]:(style),[unreadVariable],Variable 'item' is assigned a value that is never used.
[src/openstudio_lib/ScheduleDayView.cpp:640]:(style),[duplicateExpression],Same expression on both sides of '/'.
[src/shared_gui_components/OSGridController.cpp:1818]:(style),[shadowArgument],Local variable 'hasData' shadows outer argument

@jmarrec
Copy link
Collaborator Author

jmarrec commented Sep 8, 2020

Stubborn as I am, I fixed everything, except these. Can you please help decide whether we change them or do an inline suppression @macumber ? I'm overdosing on these changes... Basically we just need to get the cppcheck runner to pass.

cf https://github.com/openstudiocoalition/OpenStudioApplication/runs/1085563557?check_suite_focus=true

Here it is for convenience:

==========================================
             CPPCHECK Summary:
------------------------------------------
 * No error(s)
 * No warning(s)
 * 7 performance(s)
 * No portability(s)
 * 3 style(s)
 * No information(s)
 * No debug(s)
 * No none(s)
==========================================


cppcheck: unusedFunction check can't be used with '-j' option. Disabling unusedFunction check.
[src/model_editor/AccessPolicyStore.hpp:113]:(performance),[functionStatic],Technically the member function 'openstudio::model::AccessPolicyStore::loadFile' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:75]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::hasSetting' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:78]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::removeSetting' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:91]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:92]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:93]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/Application.hpp:94]:(performance),[functionStatic],Technically the member function 'openstudio::ApplicationSingleton::setSettingValue' can be static (but you may consider moving to unnamed namespace).
[src/model_editor/ObjectExplorer.cpp:167]:(style),[unreadVariable],Variable 'item' is assigned a value that is never used.
[src/openstudio_lib/ScheduleDayView.cpp:640]:(style),[duplicateExpression],Same expression on both sides of '/'.
[src/shared_gui_components/OSGridController.cpp:1820]:(style),[shadowArgument],Local variable 'hasData' shadows outer argument

@jmarrec
Copy link
Collaborator Author

jmarrec commented Sep 8, 2020

Note that when running without -j you get unusedFunction warnings too:

[src/bimserver/BIMserverConnection.cpp:829]:(style),[unusedFunction],The function 'checkInIFCFileBlocked' is never used.
[src/bimserver/BIMserverConnection.cpp:815]:(style),[unusedFunction],The function 'createProjectBlocked' is never used.
[src/bimserver/BIMserverConnection.cpp:822]:(style),[unusedFunction],The function 'deleteProjectBlocked' is never used.
[src/bimserver/BIMserverConnection.cpp:801]:(style),[unusedFunction],The function 'downloadBlocked' is never used.
[src/bimserver/BIMserverConnection.cpp:808]:(style),[unusedFunction],The function 'getAllProjectsBlocked' is never used.
[src/bimserver/BIMserverConnection.cpp:836]:(style),[unusedFunction],The function 'getIFCRevisionListBlocked' is never used.
[src/bimserver/BIMserverConnection.cpp:794]:(style),[unusedFunction],The function 'loginBlocked' is never used.
[src/bimserver/ProjectImporter.cpp:389]:(style),[unusedFunction],The function 'keyPressEvent' is never used.
[src/bimserver/Test/BIMserverFixture.cpp:34]:(style),[unusedFunction],The function 'SetUp' is never used.
[src/bimserver/Test/BIMserverFixture.cpp:38]:(style),[unusedFunction],The function 'SetUpTestCase' is never used.
[src/bimserver/Test/BIMserverFixture.cpp:36]:(style),[unusedFunction],The function 'TearDown' is never used.
[src/bimserver/Test/BIMserverFixture.cpp:44]:(style),[unusedFunction],The function 'TearDownTestCase' is never used.
[src/model_editor/AccessPolicyStore.cpp:196]:(style),[unusedFunction],The function 'endElement' is never used.
[src/model_editor/AccessPolicyStore.cpp:90]:(style),[unusedFunction],The function 'fatalError' is never used.
[src/model_editor/AccessPolicyStore.cpp:95]:(style),[unusedFunction],The function 'startElement' is never used.
[src/model_editor/Application.cpp:202]:(style),[unusedFunction],The function 'getSettingValueAsBool' is never used.
[src/model_editor/Application.cpp:244]:(style),[unusedFunction],The function 'getSettingValueAsDouble' is never used.
[src/model_editor/Application.cpp:223]:(style),[unusedFunction],The function 'getSettingValueAsInt' is never used.
[src/model_editor/Application.cpp:265]:(style),[unusedFunction],The function 'getSettingValueAsString' is never used.
[src/model_editor/Application.cpp:154]:(style),[unusedFunction],The function 'hasGUI' is never used.
[src/model_editor/Application.cpp:184]:(style),[unusedFunction],The function 'hasSetting' is never used.
[src/model_editor/Application.cpp:191]:(style),[unusedFunction],The function 'removeSetting' is never used.
[src/model_editor/Application.cpp:286]:(style),[unusedFunction],The function 'setSettingValue' is never used.
[src/model_editor/Application.cpp:170]:(style),[unusedFunction],The function 'sketchUpWidget' is never used.
[src/model_editor/BridgeClasses.cpp:34]:(style),[unusedFunction],The function 'bridgeSender' is never used.
[src/model_editor/EditorFrame.cpp:456]:(style),[unusedFunction],The function 'contextMenuEvent' is never used.
[src/model_editor/EditorFrame.cpp:533]:(style),[unusedFunction],The function 'getFileNameFromPath' is never used.
[src/model_editor/EditorFrame.cpp:621]:(style),[unusedFunction],The function 'newIdf' is never used.
[src/model_editor/EditorFrame.cpp:767]:(style),[unusedFunction],The function 'on_modelUpdated' is never used.
[src/model_editor/EditorFrame.cpp:133]:(style),[unusedFunction],The function 'setModels' is never used.
[src/model_editor/IGLineEdit.cpp:71]:(style),[unusedFunction],The function 'getPrec' is never used.
[src/model_editor/IGLineEdit.cpp:83]:(style),[unusedFunction],The function 'getStyle' is never used.
[src/model_editor/IGPrecisionDialog.cpp:40]:(style),[unusedFunction],The function 'on_buttonBox_accepted' is never used.
[src/model_editor/IGPrecisionDialog.cpp:45]:(style),[unusedFunction],The function 'on_buttonBox_rejected' is never used.
[src/model_editor/IGSpinBoxes.cpp:75]:(style),[unusedFunction],The function 'getFloatStyle' is never used.
[src/model_editor/IGSpinBoxes.cpp:71]:(style),[unusedFunction],The function 'setFloatStyle' is never used.
[src/model_editor/IGSpinBoxes.cpp:40]:(style),[unusedFunction],The function 'wheelEvent' is never used.
[src/model_editor/InspectorDialog.cpp:298]:(style),[unusedFunction],The function 'rebuildInspectorGadget' is never used.
[src/model_editor/ModalDialogs.cpp:307]:(style),[unusedFunction],The function 'ensureThermalZone' is never used.
[src/model_editor/OSProgressBar.cpp:131]:(style),[unusedFunction],The function 'onPercentageUpdated' is never used.
[src/model_editor/OSProgressBar.cpp:134]:(style),[unusedFunction],The function 'setRange' is never used.
[src/model_editor/ObjectExplorer.cpp:167]:(style),[unreadVariable],Variable 'item' is assigned a value that is never used.
[src/model_editor/TableView.cpp:49]:(style),[unusedFunction],The function 'keyReleaseEvent' is never used.
[src/model_editor/UserSettings.cpp:78]:(style),[unusedFunction],The function 'clearUserMeasuresDir' is never used.
[src/model_editor/Utilities.cpp:42]:(style),[unusedFunction],The function 'toWString' is never used.
[src/model_editor/tablemodel.cpp:408]:(style),[unusedFunction],The function 'dropMimeData' is never used.
[src/model_editor/tablemodel.cpp:298]:(style),[unusedFunction],The function 'moveRows' is never used.
[src/model_editor/treeitem.cpp:136]:(style),[unusedFunction],The function 'insertChildren' is never used.
[src/model_editor/treeitem.cpp:156]:(style),[unusedFunction],The function 'moveChildren' is never used.
[src/model_editor/treeitem.cpp:147]:(style),[unusedFunction],The function 'removeChildren' is never used.
[src/openstudio_app/OpenStudioApp.cpp:437]:(style),[unusedFunction],The function 'hvacComponentLibrary' is never used.
[src/openstudio_app/OpenStudioApp.cpp:1407]:(style),[unusedFunction],The function 'removeLibraryFromsSettings' is never used.
[src/openstudio_app/StartupView.cpp:191]:(style),[unusedFunction],The function 'paintEvent' is never used.
[src/openstudio_lib/ApplyMeasureNowDialog.cpp:621]:(style),[unusedFunction],The function 'addStdErrorMessage' is never used.
[src/openstudio_lib/ConstructionObjectVectorController.cpp:227]:(style),[unusedFunction],The function 'setParentWidget' is never used.
[src/openstudio_lib/GeometryEditorView.cpp:159]:(style),[unusedFunction],The function 'javascriptRunning' is never used.
[src/openstudio_lib/GridItem.cpp:254]:(style),[unusedFunction],The function 'dragEnterEvent' is never used.
[src/openstudio_lib/GridItem.cpp:259]:(style),[unusedFunction],The function 'dragLeaveEvent' is never used.
[src/openstudio_lib/GridItem.cpp:264]:(style),[unusedFunction],The function 'dropEvent' is never used.
[src/openstudio_lib/GridItem.cpp:317]:(style),[unusedFunction],The function 'getXGridPos' is never used.
[src/openstudio_lib/GridItem.cpp:188]:(style),[unusedFunction],The function 'hoverEnterEvent' is never used.
[src/openstudio_lib/GridItem.cpp:194]:(style),[unusedFunction],The function 'hoverLeaveEvent' is never used.
[src/openstudio_lib/GridItem.cpp:2099]:(style),[unusedFunction],The function 'setModelObject2' is never used.
[src/openstudio_lib/GridScene.cpp:36]:(style),[unusedFunction],The function 'getCell' is never used.
[src/openstudio_lib/HVACSystemsController.cpp:457]:(style),[unusedFunction],The function 'hvacControlsController' is never used.
[src/openstudio_lib/HVACSystemsController.cpp:453]:(style),[unusedFunction],The function 'hvacLayoutController' is never used.
[src/openstudio_lib/HVACTemplateHelperDialog.cpp:114]:(style),[unusedFunction],The function 'selectedZones' is never used.
[src/openstudio_lib/InspectorView.cpp:827]:(style),[unusedFunction],The function 'addMainView' is never used.
[src/openstudio_lib/LoopScene.cpp:93]:(style),[unusedFunction],The function 'createDemandSide' is never used.
[src/openstudio_lib/LoopScene.cpp:102]:(style),[unusedFunction],The function 'createSupplySide' is never used.
[src/openstudio_lib/LoopScene.cpp:71]:(style),[unusedFunction],The function 'initDefault' is never used.
[src/openstudio_lib/MainRightColumnController.cpp:111]:(style),[unusedFunction],The function 'emitItemRemoveClicked' is never used.
[src/openstudio_lib/MainWindow.cpp:304]:(style),[unusedFunction],The function 'loadProxySettings' is never used.
[src/openstudio_lib/MainWindow.cpp:198]:(style),[unusedFunction],The function 'selectVerticalTab' is never used.
[src/openstudio_lib/MainWindow.cpp:203]:(style),[unusedFunction],The function 'selectVerticalTabByIndex' is never used.
[src/openstudio_lib/OSAppBase.cpp:226]:(style),[unusedFunction],The function 'updateBCLMeasures' is never used.
[src/openstudio_lib/OSAppBase.cpp:210]:(style),[unusedFunction],The function 'updateMyMeasures' is never used.
[src/openstudio_lib/OSDropZone.cpp:169]:(style),[unusedFunction],The function 'maxItems' is never used.
[src/openstudio_lib/OSDropZone.cpp:213]:(style),[unusedFunction],The function 'minItems' is never used.
[src/openstudio_lib/OSItem.cpp:324]:(style),[unusedFunction],The function 'rightPixmap' is never used.
[src/openstudio_lib/OSItem.cpp:386]:(style),[unusedFunction],The function 'setAspectRatio' is never used.
[src/openstudio_lib/OSItem.cpp:300]:(style),[unusedFunction],The function 'setInspectable' is never used.
[src/openstudio_lib/OSItem.cpp:330]:(style),[unusedFunction],The function 'setRightPixmap' is never used.
[src/openstudio_lib/OSItem.cpp:360]:(style),[unusedFunction],The function 'textColor' is never used.
[src/openstudio_lib/OSItemList.cpp:119]:(style),[unusedFunction],The function 'lastItem' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:222]:(style),[unusedFunction],The function 'disableBclDlgButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:157]:(style),[unusedFunction],The function 'disableDropZone' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:219]:(style),[unusedFunction],The function 'enableBclDlgButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:154]:(style),[unusedFunction],The function 'enableDropZone' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:216]:(style),[unusedFunction],The function 'hideBclDlgButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:177]:(style),[unusedFunction],The function 'hideCopyButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:203]:(style),[unusedFunction],The function 'hidePurgeButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:213]:(style),[unusedFunction],The function 'showBclDlgButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:174]:(style),[unusedFunction],The function 'showCopyButton' is never used.
[src/openstudio_lib/OSItemSelectorButtons.cpp:200]:(style),[unusedFunction],The function 'showPurgeButton' is never used.
[src/openstudio_lib/OSWebEnginePage.cpp:39]:(style),[unusedFunction],The function 'acceptNavigationRequest' is never used.
[src/openstudio_lib/OSWebEnginePage.cpp:49]:(style),[unusedFunction],The function 'certificateError' is never used.
[src/openstudio_lib/RefrigerationController.cpp:711]:(style),[unusedFunction],The function 'createNewSystem' is never used.
[src/openstudio_lib/RefrigerationController.cpp:655]:(style),[unusedFunction],The function 'refrigerationSystemListController' is never used.
[src/openstudio_lib/RunTabController.cpp:68]:(style),[unusedFunction],The function 'updateToolsWarnings' is never used.
[src/openstudio_lib/ScheduleDayView.cpp:640]:(style),[duplicateExpression],Same expression on both sides of '/'.
[src/openstudio_lib/ScheduleDayView.cpp:651]:(style),[unusedFunction],The function 'mouseDoubleClickEvent' is never used.
[src/openstudio_lib/ScheduleDayView.cpp:876]:(style),[unusedFunction],The function 'splitSegment' is never used.
[src/openstudio_lib/SchedulesView.cpp:205]:(style),[unusedFunction],The function 'closeAllTabs' is never used.
[src/openstudio_lib/SchedulesView.cpp:968]:(style),[unusedFunction],The function 'onDefaultScheduleClicked' is never used.
[src/openstudio_lib/SchedulesView.cpp:2080]:(style),[unusedFunction],The function 'paintCell' is never used.
[src/openstudio_lib/SchedulesView.cpp:661]:(style),[unusedFunction],The function 'scheduleTabHeader' is never used.
[src/openstudio_lib/SchedulesView.cpp:383]:(style),[unusedFunction],The function 'showScheduleRuleset' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:86]:(style),[unusedFunction],The function 'addScriptToFolder' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:108]:(style),[unusedFunction],The function 'createEmptyScript' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:103]:(style),[unusedFunction],The function 'duplicateScript' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:175]:(style),[unusedFunction],The function 'folderUserScripts' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:128]:(style),[unusedFunction],The function 'folders' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:184]:(style),[unusedFunction],The function 'fsWatcher' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:99]:(style),[unusedFunction],The function 'removeScript' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:124]:(style),[unusedFunction],The function 'rootPath' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:162]:(style),[unusedFunction],The function 'saveOSArguments' is never used.
[src/openstudio_lib/ScriptFolderListView.cpp:138]:(style),[unusedFunction],The function 'selectedFolder' is never used.
[src/openstudio_lib/ScriptItem.cpp:153]:(style),[unusedFunction],The function 'deleteDb' is never used.
[src/openstudio_lib/ScriptItem.cpp:114]:(style),[unusedFunction],The function 'osArguments' is never used.
[src/openstudio_lib/ScriptItem.cpp:88]:(style),[unusedFunction],The function 'setIsUserScript' is never used.
[src/openstudio_lib/ScriptItem.cpp:135]:(style),[unusedFunction],The function 'setOSArgument' is never used.
[src/openstudio_lib/ScriptItem.cpp:176]:(style),[unusedFunction],The function 'updateArgumentsFromDb' is never used.
[src/openstudio_lib/ScriptItem.cpp:123]:(style),[unusedFunction],The function 'userScriptInfo' is never used.
[src/openstudio_lib/SimSettingsView.cpp:1215]:(style),[unusedFunction],The function 'detachAll' is never used.
[src/openstudio_lib/SimSettingsView.cpp:1936]:(style),[unusedFunction],The function 'on_runPeriodGroupClicked' is never used.
[src/openstudio_lib/ThermalZonesController.cpp:153]:(style),[unusedFunction],The function 'addComponentToZone' is never used.
[src/openstudio_lib/ThermalZonesController.cpp:213]:(style),[unusedFunction],The function 'onZoneHVACComponentClicked' is never used.
[src/openstudio_lib/ThermalZonesController.cpp:205]:(style),[unusedFunction],The function 'removeZoneHVACComponent' is never used.
[src/openstudio_lib/UtilityBillAllFuelTypesListView.cpp:100]:(style),[unusedFunction],The function 'selectedFuelType' is never used.
[src/openstudio_lib/VRFController.cpp:91]:(style),[unusedFunction],The function 'vrfSystemListController' is never used.
[src/openstudio_lib/VRFGraphicsItems.cpp:261]:(style),[unusedFunction],The function 'terminalPixmapRect' is never used.
[src/shared_gui_components/BuildingComponentDialog.cpp:237]:(style),[unusedFunction],The function 'currentTIDSelection' is never used.
[src/shared_gui_components/BuildingComponentDialog.cpp:251]:(style),[unusedFunction],The function 'rootTID' is never used.
[src/shared_gui_components/BuildingComponentDialog.cpp:263]:(style),[unusedFunction],The function 'setRootTID' is never used.
[src/shared_gui_components/CollapsibleComponentList.cpp:95]:(style),[unusedFunction],The function 'firstCollapsibleComponent' is never used.
[src/shared_gui_components/CollapsibleComponentList.cpp:99]:(style),[unusedFunction],The function 'lastCollapsibleComponent' is never used.
[src/shared_gui_components/ComponentList.cpp:92]:(style),[unusedFunction],The function 'lastComponent' is never used.
[src/shared_gui_components/EditView.cpp:212]:(style),[unusedFunction],The function 'setDisplayValue' is never used.
[src/shared_gui_components/OSDialog.cpp:184]:(style),[unusedFunction],The function 'setLayoutContentsMargins' is never used.
[src/shared_gui_components/OSDialog.cpp:98]:(style),[unusedFunction],The function 'setOkButtonAsDefault' is never used.
[src/shared_gui_components/OSGridController.cpp:1820]:(style),[shadowArgument],Local variable 'hasData' shadows outer argument
[src/shared_gui_components/OSGridController.cpp:174]:(style),[unusedFunction],The function 'getColumnsSelectedWidgets' is never used.
[src/shared_gui_components/OSGridController.cpp:608]:(style),[unusedFunction],The function 'refreshGrid' is never used.
[src/shared_gui_components/OSGridController.cpp:1204]:(style),[unusedFunction],The function 'resetConceptValue' is never used.
[src/shared_gui_components/OSListController.cpp:187]:(style),[unusedFunction],The function 'selectAllItems' is never used.
[src/shared_gui_components/OSListController.cpp:171]:(style),[unusedFunction],The function 'setAllowMultipleSelections' is never used.
[src/shared_gui_components/OSListView.cpp:78]:(style),[unusedFunction],The function 'setHorizontalScrollBarAlwaysOn' is never used.
[src/shared_gui_components/OSListView.cpp:88]:(style),[unusedFunction],The function 'setVerticalScrollBarAlwaysOn' is never used.
[src/shared_gui_components/WorkflowController.cpp:408]:(style),[unusedFunction],The function 'scriptFileName' is never used.

@macumber
Copy link
Collaborator

macumber commented Sep 9, 2020

I think we should fix the explicit constructor ones eventually, #230

[src\model_editor\BridgeClasses.hpp:43]:(style),[noExplicitConstructor],Class 'ComboHighlightBridge' has a constructor with 1 argument that is not explicit.

@macumber
Copy link
Collaborator

macumber commented Sep 9, 2020

We should ignore unusedFunction for anything we are exporting to SWIG.

@macumber
Copy link
Collaborator

macumber commented Sep 9, 2020

These all looked like likely bugs to me:

  • [src/model_editor/ObjectExplorer.cpp:167]:(style),[unreadVariable],Variable 'item' is assigned a value that is never used. - this was in a class that was unused, just removed a whole bunch of stuff with it
  • [src/openstudio_lib/ScheduleDayView.cpp:640]:(style),[duplicateExpression],Same expression on both sides of '/'. - seems to be working as is, removed the bad division
  • [src/shared_gui_components/OSGridController.cpp:1820]:(style),[shadowArgument],Local variable 'hasData' shadows outer argument - just removed the named argument, no clue what is happening there

@macumber
Copy link
Collaborator

macumber commented Sep 9, 2020

Only cppcheck error is one I don't know how to get rid of:

[nofile:0]:(information),[unmatchedSuppression],Unmatched suppression: missingInclude

@macumber macumber self-requested a review September 9, 2020 03:33
@macumber
Copy link
Collaborator

macumber commented Sep 9, 2020

@jmarrec merge away

@jmarrec jmarrec changed the base branch from develop to Qt5.15 September 9, 2020 21:04
@jmarrec
Copy link
Collaborator Author

jmarrec commented Sep 9, 2020

Merging to the Qt5.15 branch

@jmarrec jmarrec merged commit 257382b into Qt5.15 Sep 9, 2020
@jmarrec jmarrec deleted the fix_cppcheck branch September 9, 2020 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants