Showing 7 of 67 total issues
File Stash.py
has 443 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2020 XEBIALABS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Function bitbucket_downloadcode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def bitbucket_downloadcode(self, variables):
downloadURL = "%s/%s/get/%s.zip" % (
variables["server"]["url"].replace("api.", "www."),
variables["repo_full_name"],
variables["branch"],
Function stash_downloadcode
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def stash_downloadcode(self, variables):
downloadURL = (
"%s/rest/archive/latest/projects/%s/repos/%s/archive?at=refs/heads/%s&format=zip"
% (
variables["server"]["url"],
Function start_pr_release
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def start_pr_release(
Function start_new_branch_release
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def start_new_branch_release(
Function findNewCommit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def findNewCommit(oldCommitMap, newCommitMap):
branch = ""
commitId = ""
# loop over new map branches
- 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 findNewCommit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def findNewCommit(oldCommitMap, newCommitMap):
branch = None
commitId = None
# loop over new map branches
- 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"