KarrLab/obj_tables

View on GitHub

Showing 425 of 542 total issues

Function get_xlsx_validation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def get_xlsx_validation(self, sheet_models=None, doc_metadata_model=None):
        """ Get XLSX validation

        Args:
            sheet_models (:obj:`list` of :obj:`Model`, optional): models encoded as separate sheets
Severity: Minor
Found in obj_tables/sci/units.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 clean has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def clean(self, value):
        """ Convert attribute value into the appropriate type

        Args:
            value (:obj:`object`): value of attribute to clean
Severity: Minor
Found in obj_tables/sci/onto.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 clean has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def clean(self, value):
        """ Convert attribute value into the appropriate type

        Args:
            value (:obj:`object`): value of attribute to clean
Severity: Minor
Found in obj_tables/core.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 validate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def validate(self, obj, value):
        """ Determine if :obj:`value` is a valid value

        Args:
            obj (:obj:`Model`): class being validated
Severity: Minor
Found in obj_tables/bio/seq.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 deserialize has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def deserialize(self, value, objects, decoded=None):
        """ Deserialize value

        Args:
            value (:obj:`str`): String representation
Severity: Minor
Found in obj_tables/core.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 save_in_workbook has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def save_in_workbook(file_storage):
    """ Save workbook to a temporary directory

    Args:
        file_storage (:obj:`FileStorage`): uploaded file
Severity: Minor
Found in obj_tables/web_service.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 validate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def validate(self, obj, value):
        """ Determine if :obj:`value` is a valid value of the attribute

        Args:
            obj (:obj:`Model`): object being validated
Severity: Minor
Found in obj_tables/core.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 get_nested_attr has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def get_nested_attr(cls, attr_path):
        """ Get the value of an attribute or a nested attribute of a model

        Args:
            attr_path (:obj:`list` of :obj:`list` of :obj:`str`):
Severity: Minor
Found in obj_tables/core.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 get_children has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def get_children(self, kind=None, __type=None, recursive=True, **kwargs):
        """ Get a kind of children.

        If :obj:`kind` is :obj:`None`, children are defined to be the values of the related attributes defined
        in each class.
Severity: Minor
Found in obj_tables/core.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 clean has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def clean(self, value):
        """ Convert attribute value into the appropriate type

        Args:
            value (:obj:`object`): value of attribute to clean
Severity: Minor
Found in obj_tables/core.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 get_fields has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def get_fields(cls, schema_name, date, doc_metadata, doc_metadata_model, model_metadata, include_all_attributes=True, sheet_models=None):
    """ Get the attributes, headings, and validation for a worksheet

    Args:
        cls (:obj:`type`): Model type (subclass of :obj:`Model`)
Severity: Minor
Found in obj_tables/io.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 run has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def run(self, path, schema_name=None, models=None,
Severity: Major
Found in obj_tables/io.py - About 1 hr to fix

    Function convert has 14 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def convert(source, destination, schema_name=None, models=None,
    Severity: Major
    Found in obj_tables/io.py - About 1 hr to fix

      Function run has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def run(self, path, schema_name=None, models=None,
      Severity: Major
      Found in obj_tables/io.py - About 1 hr to fix

        Function validate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def validate(self, objects):
                """ Validate a list of objects and return their errors
        
                Args:
                    object (:obj:`list` of :obj:`Model`): list of Model instances
        Severity: Minor
        Found in obj_tables/core.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 run has 14 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def run(self, path, schema_name=None, models=None,
        Severity: Major
        Found in obj_tables/io.py - About 1 hr to fix

          Function run has 14 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def run(self, path, schema_name=None, models=None,
          Severity: Major
          Found in obj_tables/io.py - About 1 hr to fix

            Function run has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def run(self, path, schema_name=None, models=None,
            Severity: Major
            Found in obj_tables/io.py - About 1 hr to fix

              Function get_models has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              def get_models(module=None, inline=True):
                  """ Get models
              
                  Args:
                      module (:obj:`module`, optional): module
              Severity: Minor
              Found in obj_tables/core.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 __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, ontology, namespace=None, namespace_sep=':', terms=None, none=True,
              Severity: Major
              Found in obj_tables/sci/onto.py - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language