Function process
has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring. Open
def process(do_rename_dir, do_rename_files, do_dates=0):
print("A sound will be produced at the end of the processing.")
print("What follows is also logged into the file logRename.txt\r\n")
print('Press <ctrl>+C to abort')
printandlog("########################################")
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File naming_conventions_files.py
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
# toutes les chaines sont en unicode (même les docstrings)
from __future__ import unicode_literals
Function correctYMD
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def correctYMD(s, regexen, regexus):
matched = regexen.search(s)
if matched: # push it to the front, order reversed
splits = regexen.split(s)
if splits[2] != splits[4]:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function correctYM
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def correctYM(s, regexen, regexus):
matched = regexen.search(s)
if matched: # push it to the front, order reversed
splits = regexen.split(s)
if int(splits[3]) > maxYear:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function main
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
if (len(sys.argv) == 1):
process(0, 0, 0)
os.system("pause")
else:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function correctYY
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def correctYY(s, regex):
matched = regex.search(s)
if matched: # push it to the front, separated by -
splits = regex.split(s)
if int(splits[1]) > maxYear:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function correctPureYMD
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def correctPureYMD(s, regexen):
matched = regexen.search(s)
if matched: # push it to the front, order reversed
splits = regexen.split(s)
if int(splits[1]) > maxYear:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function subs_dates
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def subs_dates(s):
(s, matched) = correctYY(s, regExDatesYYYYtoYYYY)
if not matched:
(s, matched) = correctYMD(s, regExDatesDDMMYYYY, regExDatesYYYYMMDD)
if not matched:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if subdir == '__pycache__':
continue
if subdir == '.':
Avoid deeply nested control flow statements. Open
if (do_dates):
stripped = subs_dates(stripped)
nbDir = nbDir + 1
Avoid deeply nested control flow statements. Open
if subdir == '.':
continue
if subdir == '..':
Avoid deeply nested control flow statements. Open
if (same_string(stripped, subdir)):
printandlogNoRC('.');
sys.stdout.flush()
else:
if (not found):
Avoid deeply nested control flow statements. Open
if (same_string(stripped, file)):
printandlogNoRC('*');
sys.stdout.flush()
else:
nbFileChanges = nbFileChanges + 1
Avoid deeply nested control flow statements. Open
if subdir == '..':
continue
stripped = accentsTidy(subdir)
Avoid deeply nested control flow statements. Open
if (do_dates):
stripped = subs_dates(stripped)
nbFiles = nbFiles + 1
Function correctY
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def correctY(s, regex):
matched = regex.search(s)
if matched: # push it to the front, order reversed
splits = regex.split(s)
if int(splits[1]) > maxYear:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return (sout, True)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (sout, True)
Avoid too many return
statements within this function. Open
return (sout, True)
Avoid too many return
statements within this function. Open
return (sout, True)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (sout, True)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)
Avoid too many return
statements within this function. Open
return (s, False)