Showing 102 of 115 total issues
Function checkValidP4Users
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def checkValidP4Users(self, commits):
"""Check if any git authors cannot be mapped to p4 users."""
for id in commits:
user, email = self.p4UserForCommit(id)
if not user:
- 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 generateTZList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function generateTZList() {
var timezones = [
{ value: "utc", descr: "UTC/GMT"},
{ value: "local", descr: "Local (per browser)"}
];
- 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 p4BranchesInGit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def p4BranchesInGit(branchesAreInRemotes=True):
"""Find all the branches whose names start with "p4/", looking
in remotes or heads as specified by the argument. Return
a dictionary of { branch: revision } for each one found.
The branch names are the short names, without any
- 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
Method Proxy.Run
has 5 return statements (exceeds 4 allowed). Open
func (p *Proxy) Run() error {
hl, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return fmt.Errorf("http listen failed: %v", err)
}
Function lastP4Changelist
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def lastP4Changelist(self):
"""Get back the last changelist number submitted in this client spec.
This then gets used to patch up the username in the change. If the
same client spec is being used by multiple processes then this might
- 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 p4_describe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def p4_describe(change, shelved=False):
"""Make sure it returns a valid result by checking for the presence of
field "time".
Return a dict of the results.
- 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
Method Socket.checkPermissions
has 5 return statements (exceeds 4 allowed). Open
func (s Socket) checkPermissions() error {
fi, err := os.Stat(s.Dir)
if err != nil {
return err
}
Function formatTimezoneInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function formatTimezoneInfo(hours, minutes, sep) {
minutes = minutes || 0; // to be able to use formatTimezoneInfo(hh)
sep = sep || ''; // default format is +/-ZZZZ
if (minutes < 0 || minutes > 59) {
- 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 addChangeTZ
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function addChangeTZ(tzSelected, tzCookieInfo, tzClassName) {
// make link to timezone UI discoverable
addCssRule('.'+tzClassName + ':hover',
'text-decoration: underline; cursor: help;');
- 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 streamTag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def streamTag(self, gitStream, labelName, labelDetails, commit, epoch):
"""Stream a p4 tag.
Commit is either a git commit, or a fast-import mark, ":<p4commit>".
"""
- 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;
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return submitted
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return escaped_bytes
Function findColorNo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function findColorNo(tr_prev, tr_next) {
var color_prev = getColorNo(tr_prev);
var color_next = getColorNo(tr_next);
- 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 p4_keywords_regexp_for_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def p4_keywords_regexp_for_type(base, type_mods):
"""Given a type base and modifier, return a regexp matching the keywords
that can be expanded in the file.
"""
- 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 sync_origin_only
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sync_origin_only(self):
if self.syncWithOrigin:
self.hasOrigin = originP4BranchesExist()
if self.hasOrigin:
if not self.silent:
- 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"