Skip to content

Commit 6503d24

Browse files
committed
Fix some sonar warnings
1 parent d3efb20 commit 6503d24

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎ElementsExamples/python/ElementsExamples/PythonProgramExample.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def defineSpecificProgramOptions():
1212

1313

1414
def mainMethod(args):
15-
logger = log.getLogger('PyhtonProgramExample')
15+
logger = log.getLogger('PythonProgramExample')
1616

1717
logger.info('#')
1818
logger.info('# Logging from the mainMethod() of the PythonProgramExample ')
@@ -23,11 +23,11 @@ def mainMethod(args):
2323
logger.info('# Adding the values of the int list')
2424
if not args.int_list:
2525
raise Exception('--int-list parameter missing')
26-
sum = 0
26+
arg_sum = 0
2727
for i in args.int_list:
2828
logger.debug('Adding %d', i)
29-
sum += i
30-
logger.info('Sum = %d', sum)
29+
arg_sum += i
30+
logger.info('Sum = %d', arg_sum)
3131
except Exception as e:
3232
logger.error('Something went wrong...')
3333
logger.exception(e)

‎ElementsKernel/scripts/make_patch.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
def command(cmd, *args, **kwargs):
1212
"""
13-
Simple wrapper to execute a command and return standard output and standard error.
13+
Simple wrapper to execute a command and return standard output and standard
14+
error.
1415
"""
1516
d = {"stdout": PIPE, "stderr": PIPE}
1617
d.update(kwargs)
@@ -199,7 +200,8 @@ def main():
199200
opts.exclusions.append(os.environ["CMTCONFIG"])
200201

201202
# check if we are in the cmt directory before broadcasting
202-
if not (os.path.basename(os.getcwd()) == "cmt" and os.path.exists("requirements")):
203+
if not (os.path.basename(os.getcwd()) == "cmt"
204+
and os.path.exists("requirements")):
203205
logging.error(
204206
"This script must be executed from the cmt directory of a package.")
205207
return 1

0 commit comments

Comments
 (0)