KarrLab/obj_tables

View on GitHub

Showing 425 of 542 total issues

Function validate has a Cognitive Complexity of 7 (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 35 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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def create(self, __type=None, **kwargs):
        """ Create instance of primary class and add to list

        Args:
            __type (:obj:`types.TypeType` or :obj:`tuple` of :obj:`types.TypeType`): subclass(es) of :obj:`Model`
Severity: Minor
Found in obj_tables/core.py - About 35 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 set_value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def set_value(self, obj, new_value):
        """ Update the values of the related attributes of the attribute

        Args:
            obj (:obj:`object`): object whose attribute should be set
Severity: Minor
Found in obj_tables/core.py - About 35 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 get_xlsx_validation has a Cognitive Complexity of 7 (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/core.py - About 35 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 _get_tabular_schema_format has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_tabular_schema_format(self):
        """ Generate a string which represents the format of the attribute for use
        in tabular-formatted schemas

        Returns:
Severity: Minor
Found in obj_tables/core.py - About 35 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 _get_attribute_types has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_attribute_types(self, model_obj, attr_names):
        """ Provide the attribute types for a tuple of attribute names

        Args:
            model_obj (:obj:`Model`): a :obj:`Model` instance
Severity: Minor
Found in obj_tables/core.py - About 35 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 _generate_normalize_sort_key_unique_together has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _generate_normalize_sort_key_unique_together(cls, processed_models=None):
        """ Generate a key for sorting models by their shortest set of unique attributes into a normalized order

        Args:
            processed_models (:obj:`list`, optional): list of models for which sort keys have already been generated
Severity: Minor
Found in obj_tables/core.py - About 35 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 sort has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def sort(cls, objects):
        """ Sort list of :obj:`Model` objects

        Args:
            objects (:obj:`list` of :obj:`Model`): list of objects
Severity: Minor
Found in obj_tables/core.py - About 35 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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, attr, primary_class, is_primary=True):
        """
        Args:
            attr (:obj:`Attribute`): attribute
            primary_class (:obj:`type`): class in which :obj:`attr` was defined
Severity: Minor
Found in obj_tables/core.py - About 35 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 get_xlsx_validation has a Cognitive Complexity of 7 (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/core.py - About 35 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

Avoid too many return statements within this function.
Open

                return;
Severity: Major
Found in obj_tables/web/js/app.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return ([], None)
    Severity: Major
    Found in obj_tables/sci/refs.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return InvalidObject(model_obj, [attr_err])
      Severity: Major
      Found in obj_tables/math/expression.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return None
        Severity: Major
        Found in obj_tables/math/expression.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return;
          Severity: Major
          Found in obj_tables/web/js/app.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return;
            Severity: Major
            Found in obj_tables/web/js/app.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return;
              Severity: Major
              Found in obj_tables/web/js/app.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return None
                Severity: Major
                Found in obj_tables/sci/onto.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return InvalidObject(model_obj, [attr_err])
                  Severity: Major
                  Found in obj_tables/math/expression.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return (self._obj_tables_tokens, self.related_objects, None)
                    Severity: Major
                    Found in obj_tables/math/expression.py - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language