Showing 78 of 108 total issues
Method parseReportResponse
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseReportResponse ( $xml_response ) {
$statusCode = $xml_response->runReportResponse->statusCode;
switch ( $statusCode ) {
case 1: // Created
Method curl_download
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function curl_download( $url, $cert, $vars = NULL ) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
Method runSearch
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runSearch() {
$xml = $this->runSearchRequest();
$request = $this->createRequest( $xml );
$rc = $this->sendRequest( $request );
Function fetch
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def fetch():
out = csv.DictWriter(sys.stdout, [
'campaign',
'banner',
'start',
- 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 should_send
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def should_send(self, out, queue_name, row, event_type):
if not queue_name:
log.info("-Unknown\t{id}\t{date}\t(Type {type})".format(id=out['gateway_txn_id'], date=out['date'], type=event_type))
return False
- 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_gdoc_spec
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update_gdoc_spec(doc=None, spec=None):
log.info("Updating test specs with latest CentralNotice changes... {url}".format(url=doc))
# FIXME: currently, the spec must have been read with read_gdoc_spec in order to get row numbers
if not spec:
- 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_geonames_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def import_geonames_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 main
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(host, port, user, password, database, tablename, delete, autoindex, schema, filename):
Function parseReportResponse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function parseReportResponse ( $xml_response ) {
$statusCode = $xml_response->runReportResponse->statusCode;
switch ( $statusCode ) {
case 1: // Created
- 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 get_totals
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_totals(wheres=None, query=None, banner=None, campaign=None, country=None, start=None, end=None, **ignore):
'''
Note that the column names must match a heading in the results spreadsheet.
'''
config = 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"
Further reading
Function tests_from_entry
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def tests_from_entry(entry):
'''
Returns a tuple, (test ended, test begun)
Start and end times are fudged quite a bit, all we care about
- 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 runAudit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runAudit( $begin, $end ) {
$report = new CustomReport( array ( $begin . ' 00:00:00', $end . ' 23:59:59') );
if ( $report->runReport()) {
$results = $report->getResults();
} else {
Function pull
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def pull():
'''Pull down new remote files'''
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"
Further reading
Function main
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def main(host, port, user, password, database, tablename, delete, autoindex, schema, filename):
global colproto
# === Connection to MySQL ===
db = MySQL.connect(host=host, port=port, user=user, passwd=password, db=database)
- 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 rotate_files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def rotate_files():
config = process.globals.get_config()
# Clean up after ourselves
if config.days_to_keep_files:
- 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 execute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def execute(self, sql, params=None, timeout=0):
cursor = self.db_conn.cursor(cursor=pymysql.cursors.DictCursor)
deathClock = None
if self.debug:
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main(host, port, user, password, database, tablename, delete, autoindex, schema, filename):
global colproto
# === Connection to MySQL ===
db = MySQL.connect(host=host, port=port, user=user, passwd=password, db=database)
Function updateAll
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def updateAll():
log.info("Loading schema update set ")
drop_queries = load_queries('drop_schema.sql')
log.info("Loading schema update set ")
rebuild_queries = load_queries('rebuild_schema.sql')
Method parseSearchResponse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseSearchResponse ( $xml_response ) {
$responseCode = $xml_response->baseResponse->responseCode; // if xml fails its statusCode
switch ( $responseCode ) {
case 100:
Function main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
# Extract any command line options
parser = OptionParser(usage="usage: %prog [options] <working directory>")
parser.add_option("-c", "--config", dest='configFile', default=None, help='Path to configuration file')
(options, args) = parser.parse_args()