Showing 136 of 361 total issues
Function get_file_list
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def get_file_list(self, lstPaths, lstXtn, lstExcluded, VERBOSE = False):
"""
builds a list of files and returns as a list
"""
if VERBOSE:
- 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
File review_ontology.py
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
# review_ontology.py written by Duncan Murray 24/3/2014
# script to document and test samples of ontologies for
# possible use in AIKIF. Consensus seems to be to build
# your own ontology but this seems redundant (would be best
Function reverse_pivot_to_fact
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def reverse_pivot_to_fact(self, staging_table, piv_column, piv_list, from_column, meas_names, meas_values, new_line):
"""
For each column in the piv_list, append ALL from_column's using the group_list
e.g.
Input Table
- 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 pick_next_boat_trip
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def pick_next_boat_trip(node, m, c, frontier):
"""
based on current situation, pick who
gets transported next, and return the path
NOTE - improvement here as there are often
- 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 solve
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def solve(self, max_worlds=10000, silent=False):
"""
find the best world to make people happy
"""
self.num_worlds = 0
- 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_adjacency_matrix
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def get_adjacency_matrix(self, show_in_console=False):
""" return the matrix as a list of lists
raw graph = {'1': ['2', '3', '4'], '2': ['6', '7']}
6 nodes: ['1', '2', '3', '4', '6', '7']
5 links: [['1', '2'], ['1', '3'], ['1', '4'], ['2', '6'], ['2', '7']]
- 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
File image_tools.py
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
# coding: utf-8
# image_tools.py written by Duncan Murray 1/7/2014
import os
File mapper.py
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# mapper.py
import os
Function GetFileList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def GetFileList(rootPaths, lstXtn, shortNameOnly='Y'):
"""
builds a list of files and returns as a list
"""
numFiles = 0
- 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 save_filelist
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def save_filelist(self, opFile, opFormat, delim=',', qu='"'):
"""
uses a List of files and collects meta data on them and saves
to an text file as a list or with metadata depending on opFormat.
"""
- 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
Grid
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Grid(object):
"""
Class to run the game logic.
"""
Function do_your_job
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def do_your_job(self):
"""
the goal of the explore agent is to move to the
target while avoiding blockages on the grid.
This function is messy and needs to be looked at.
- 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
File cls_log.py
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
# coding: utf-8
# cls_log.py
import os
File core_data.py
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# core_data.py
import os
Function filelist2html
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def filelist2html(lst, fldr, hasHeader='N'):
"""
formats a standard filelist to htmk using table formats
"""
txt = '<TABLE width=100% border=0>'
- 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
File happiness.py
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
# happiness.py written by Duncan Murray 20/2/2015
def TEST():
"""
Modules for testing happiness of 'persons' in 'worlds'
Function search_aikif
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def search_aikif(txt, formatHTML=True):
"""
search for text - currently this looks in all folders in the
root of AIKIF but that also contains binaries so will need to
use the agent_filelist.py to specify the list of folders.
- 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
SQLCodeGenerator
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class SQLCodeGenerator(object):
""" generates SQL based on a table """
def __init__(self, fact_table):
self.fact_table = fact_table
self.sql_text = '' # for the main procedure
DataTable
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class DataTable(object):
"""
A data table is a single grid of data, such as a
CSV / TXT file or database view or table.
Function select_where
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def select_where(self, where_col_list, where_value_list, col_name=''):
"""
selects rows from the array where col_list == val_list
"""
res = [] # list of rows to be returned
- 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"