michal-stuglik/django-mips

View on GitHub

Showing 9 of 17 total issues

Function mips_for_reference_list has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def mips_for_reference_list(lista):

    for ref in lista:
        for mip in Mip.objects.filter(reference_id=ref):
            print ref, mip.mip_id, ['immuno' if mip.mip_func_immuno else '-'][0], ['mapping' if mip.mip_func_mapping else '-'][0], \
Severity: Minor
Found in mips/example/examples2.py - About 1 hr to fix

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_samples has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def load_samples(file_path):
    print 'Function {} ...'.format(load_samples.__name__)

    header_read = False
    with open(file_path, 'r') as f:
Severity: Minor
Found in mips/data_manager/import_methods.py - About 1 hr to fix

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_paralogs has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def load_paralogs(file_path):
    print 'Function {} ...'.format(load_paralogs.__name__)

    header_read = False
    with open(file_path, 'r') as f:
Severity: Minor
Found in mips/data_manager/import_methods.py - About 1 hr to fix

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_mips has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def load_mips(file_path):
    """Insert/Update mip objects. """

    print 'Function {} ...'.format(load_mips.__name__)

Severity: Minor
Found in mips/data_manager/import_methods.py - About 1 hr to fix

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_sample_subspecies has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def load_sample_subspecies(file_path):
    print 'Function {} ...'.format(load_sample_subspecies.__name__)

    header_read = False
    with open(file_path, 'r') as f:
Severity: Minor
Found in mips/data_manager/import_methods.py - About 1 hr to fix

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_mip_instances has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def load_mip_instances(file_path):
    print 'Function {} ...'.format(load_mip_instances.__name__)

    header_read = False
    with open(file_path, 'r') as f:
Severity: Minor
Found in mips/data_manager/import_methods.py - About 1 hr to fix

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_subspecies has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def load_subspecies(file_path):
    print 'Function {} ...'.format(load_subspecies.__name__)

    header_read = False
    with open(file_path, 'r') as f:
Severity: Minor
Found in mips/data_manager/import_methods.py - About 1 hr to fix

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 func_mips_for_montandoni has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def func_mips_for_montandoni():

    for montandoni_samples in SampleSubspecies.objects.filter(subspecies_fk="montandoni"):
        for Sample_mip in Samples.objects.filter(sample_fk=montandoni_samples.sample_id):
            if Sample_mip.mip_fk.mip_func_mapping is True:
Severity: Minor
Found in mips/example/examples2.py - About 25 mins to fix

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 samples_for_mips has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def samples_for_mips(lista):

    for ref in lista:
        for mip in Mip.objects.filter(reference_id=ref):
            for sample in Samples.objects.filter(mip_fk=mip):
Severity: Minor
Found in mips/example/examples2.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language