Showing 78 of 108 total issues
Function getData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def getData(host, port, username, password, database):
Function getPerYearData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def getPerYearData(host, port, username, password, database):
Function parseSearchResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function parseSearchResponse ( $xml_response ) {
$responseCode = $xml_response->baseResponse->responseCode; // if xml fails its statusCode
switch ( $responseCode ) {
case 100:
- 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 parseSearchResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function parseSearchResponse ( $xml_response ) {
$responseCode = $xml_response->baseResponse->responseCode; // if xml fails its statusCode
switch ( $responseCode ) {
case 100:
- 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 import_altnames_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def import_altnames_file(filename):
global _geonamesDB
# === Prepare things ===
try:
- 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 loadPybal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def loadPybal(pattern):
files = []
for root, dirnames, filenames in os.walk('pybal'):
for filename in fnmatch.filter(filenames, pattern):
files.append(os.path.join(root, filename))
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def main():
# === Extract options ===
parser = OptionParser(usage="usage: %prog [options]")
parser.add_option("-p", "--project", dest='project', default='wikipedia', help='')
parser.add_option("-l", "--language", dest='language', default='en', 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 update_row
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_row(self, props, index=None, matching=None):
if matching:
# TODO
# if len(matches) > 1:
# raise Exception
- 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 True
Avoid too many return
statements within this function. Open
return
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 paramiko.ECDSAKey(data=base64.b64decode(keystr.split(' ')[1]))
Function load_queries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_queries(script_path):
'''
Helper to parse queries out of a SQL file. Requires that each statement
ends in ;
'''
- 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 load_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_results(self):
if self.is_banner_test and self.banners:
cases = []
for name in self.banners:
test_case = self.get_case(
- 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 iterated_test
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def iterated_test(self, num_tests, coverage_alpha, improvement_only=False):
"""
Compute a p-value testing null hypothesis H0: p_baseline == p_variation against alternative
hypothesis H1: p_baseline != p_variation by summing p-values conditioned on individual
baseline success counts. This provides a more accurate correction for multiple testing but
- 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 is_reject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_reject(self, row):
if not hasattr(self.config, 'rejects') or not isinstance(self.config.rejects, dict):
return False
for key in self.config.rejects:
config_val = self.config.rejects[key]
- 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 load_queries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_queries(file):
# TODO: Reuse database.db.load_queries
config = process.globals.get_config()
- 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"