Showing 17 of 25 total issues
Function printVersionBlock
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def printVersionBlock(self, deps, version, date, tickets):
baseoutput = BaseWriter.BaseWriter.printVersionBlock(self, deps, version, date, tickets)
if baseoutput is not None:
return baseoutput
- Read upRead up
- Create a ticketCreate a ticket
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 printVersionBlock
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def printVersionBlock(self, deps, version, date, tickets):
baseoutput = BaseWriter.BaseWriter.printVersionBlock(self, deps, version, date, tickets)
if baseoutput is not None:
return baseoutput + "\n"
- Read upRead up
- Create a ticketCreate a ticket
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 generateReleaseNotesByPromotedVersions
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def generateReleaseNotesByPromotedVersions(self, writer):
ticketsSoFar = []
hashesInVersion = self.__repo.gitHistoryByVersion
- Read upRead up
- Create a ticketCreate a ticket
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 generate_release_notes
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def generate_release_notes(configFile):
requests.packages.urllib3.disable_warnings()
file = open(configFile, 'r')
fileContents = file.read()
releaseNotesConfig = EnvReplacer.replace(json.loads(fileContents))
- Read upRead up
- Create a ticketCreate a ticket
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 retrieveDependeciesVersions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def retrieveDependeciesVersions(self, version):
if "DirectDependencies" not in self.__conf:
return {}
if len(self.__conf["DirectDependencies"].keys()) == 0:
- Read upRead up
- Create a ticketCreate a ticket
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 retrieveVersionsByGitHash
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def retrieveVersionsByGitHash(self, promotedVersionsList):
self.__log("Retrieving versions (git tags)...")
if len(promotedVersionsList) == 0:
print("Make sure you first retrieve the promoted version: Promoted versions are empty, thus every tag "
- Read upRead up
- Create a ticketCreate a ticket
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 __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, conf):
self.gitCommitsList = []
self.gitCommitMessagesByHash = {}
self.gitDatesByHash = {}
self.versionsByGitHash = {}
- Read upRead up
- Create a ticketCreate a ticket
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
for ticket, link in list(ticketInfo["embedded_link"].items()):
title = re.sub(ticket, "<a href=\"{0}\">{1}</a>".format(link, ticket), title)
imgFormat = '<img src="{1}" alt="{0}" width="16" height="16" style="padding-right: 5px"></img>'
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for ticket, link in list(ticketInfo["embedded_link"].items()):
title = re.sub(ticket, "[{1}]({0})".format(link, ticket), title)
iconPart = ""
- Create a ticketCreate a ticket
Function generateForOneWriter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generateForOneWriter(generator, ticketProvider, writerType, directory, fileName):
- Create a ticketCreate a ticket
Function __optimizeHistoryByVersion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __optimizeHistoryByVersion(self):
sortedVersionsInAscendingOrder = [] + list(self.gitHistoryByVersion.keys())
sortedVersionsInAscendingOrder.sort(key=lambda s: list(map(int, s.split('.'))), reverse=False)
# remove commits part of newer versions if they exists in older one
- Read upRead up
- Create a ticketCreate a ticket
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 __printVersionBlock
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __printVersionBlock(self, version, tickets, writer, date):
deps = {}
if version != self.__PendingPromotionCaption:
if version in self.__promotedVersionsInfo:
date = self.__promotedVersionsInfo[version]["date"]
- Read upRead up
- Create a ticketCreate a ticket
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 __replaceStr(str(config))
- Create a ticketCreate a ticket
Function getTicketInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getTicketInfo(self, ticket):
data = self.__readJsonInfo(ticket)
if "title" in data:
title = data["title"]
- Read upRead up
- Create a ticketCreate a ticket
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 printVersionBlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def printVersionBlock(self, deps, version, date, tickets):
# get the content of a specific version if already present
if version in self.versionsAlreadyPresent.keys():
return json.dumps(self.versionsAlreadyPresent[version], indent=2, sort_keys=True)
- Read upRead up
- Create a ticketCreate a ticket
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 setInitialContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def setInitialContent(self, content):
currentVersion = None
for line in content.split("\n"):
v = self.deconvertVersion(self.parseVersionHeader(line))
if v is not False and v != str(sys.maxsize):
- Read upRead up
- Create a ticketCreate a ticket
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 retrievePromotedVersions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def retrievePromotedVersions(self):
self.__log("Retrieving promoted ({0}) versions {1} ...".format(
self.__conf["Repository"],
self.__conf["ArtifactUri"]))
- Read upRead up
- Create a ticketCreate a ticket
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"