Project

General

Profile

Necessary Maintenance #25310

Static code check warnings

Added by Iker de Icaza Astiz 3 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Low
Start date:
12/11/2020
Due date:
% Done:

100%

Estimated time:
Duration:

Description

I'm running cppcheck on the project files. These are the warnings that I get.

cppcheck --enable=all --inconclusive --library=posix *.cpp *.hpp
Checking daqinterfacestate.cpp ...
daqinterfacestate.cpp:246:11: style: Redundant initialization for 'palette'. The initialized value is overwritten before it is read. [redundantInitialization]
  palette = ui->lcdRunNumber->palette();
          ^
daqinterfacestate.cpp:245:20: note: palette is initialized
  QPalette palette = ui->lcdPartitionNumber->palette();
                   ^
daqinterfacestate.cpp:246:11: note: palette is overwritten
  palette = ui->lcdRunNumber->palette();
          ^
daqinterfacestate.cpp:264:11: style: Redundant initialization for 'palette'. The initialized value is overwritten before it is read. [redundantInitialization]
  palette = ui->lcdRunNumber->palette();
          ^
daqinterfacestate.cpp:263:20: note: palette is initialized
  QPalette palette = ui->lcdPartitionNumber->palette();
                   ^
daqinterfacestate.cpp:264:11: note: palette is overwritten
  palette = ui->lcdRunNumber->palette();
          ^
daqinterfacestate.cpp:205:43: style:inconclusive: Function 'setRun_number' argument 1 names different: declaration 'value' definition 'run_number'. [funcArgNamesDifferent]
void daqInterfaceState::setRun_number(int run_number)
                                          ^
daqinterfacestate.hpp:44:26: note: Function 'setRun_number' argument 1 names different: declaration 'value' definition 'run_number'.
  void setRun_number(int value);
                         ^
daqinterfacestate.cpp:205:43: note: Function 'setRun_number' argument 1 names different: declaration 'value' definition 'run_number'.
void daqInterfaceState::setRun_number(int run_number)
                                          ^
1/15 files checked 8% done
Checking daqinterfacestate.hpp ...
2/15 files checked 9% done
Checking db_dialog.cpp ...
3/15 files checked 14% done
Checking db_dialog.hpp ...
4/15 files checked 15% done
Checking env_vars.hpp ...
5/15 files checked 17% done
Checking gui_utility_functions.hpp ...
6/15 files checked 17% done
Checking main.cpp ...
7/15 files checked 18% done
Checking mainwindow.cpp ...
mainwindow.cpp:1077:3: style: Statements following return, break, continue, goto or throw will never be executed. [unreachableCode]
  qDebug() << "Ending" << Q_FUNC_INFO;
  ^
mainwindow.cpp:1091:3: style: Statements following return, break, continue, goto or throw will never be executed. [unreachableCode]
  qDebug() << "Ending" << Q_FUNC_INFO;
  ^
mainwindow.cpp:725:8: style: Unused variable: some_non_used_var2 [unusedVariable]
  bool some_non_used_var2;
       ^
8/15 files checked 76% done
Checking mainwindow.hpp ...
9/15 files checked 81% done
Checking menuoptionsdialog.cpp ...
10/15 files checked 84% done
Checking menuoptionsdialog.hpp ...
11/15 files checked 85% done
Checking messagehandler.cpp ...
12/15 files checked 86% done
Checking messagehandler.hpp ...
13/15 files checked 87% done
Checking xmlrpc_gui_comm.cpp ...
xmlrpc_gui_comm.cpp:6:3: performance: Variable 'serverUrl' is assigned in constructor body. Consider performing initialization in initialization list. [useInitializationList]
  serverUrl = "http://localhost:" + env_vars::rpc_port + "/RPC2";
  ^
14/15 files checked 98% done
Checking xmlrpc_gui_comm.hpp ...
15/15 files checked 100% done
mainwindow.cpp:170:0: style: The function 'closeEvent' is never used. [unusedFunction]

^
mainwindow.cpp:1073:0: style: The function 'getDBConfigurationFHICL_dir' is never used. [unusedFunction]

^
mainwindow.cpp:1087:0: style: The function 'getQProcessEnvironment' is never used. [unusedFunction]

^
nofile:0:0: information: Cppcheck cannot find all the include files (use --check-config for details) [missingInclude]

Related issues

Blocks ArtDaq RunControl GUI - Milestone #25316: v1_02_00Resolved12/14/2020

History

#1 Updated by Iker de Icaza Astiz 3 months ago

  • Assignee set to Iker de Icaza Astiz

Let's use branch maintenance/cppcheck to tackle these.

#2 Updated by Iker de Icaza Astiz 3 months ago

#3 Updated by Iker de Icaza Astiz 3 months ago

#4 Updated by Iker de Icaza Astiz 3 months ago

#5 Updated by Iker de Icaza Astiz 3 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Resolved

Branch feature/refactoring handles this issue, amongst others.

I've merged it now, so marking this as solved.

#6 Updated by Iker de Icaza Astiz about 2 months ago

  • Status changed from Resolved to Closed

Included in latest release.

Closing.

Also available in: Atom PDF