KarrLab/obj_tables

View on GitHub
obj_tables/core.py

Summary

Maintainability
F
2 mos
Test Coverage
A
99%

File core.py has 7031 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Toolkit for modeling complex datasets with collections of user-friendly tables

Many classes contain the methods ``serialize()`` and `deserialize()``, which invert each other.
``serialize()`` converts a python object instance into a string representation, whereas
``deserialize()`` parses an object's string representation -- as would be stored in a file or spreadsheet
Severity: Major
Found in obj_tables/core.py - About 2 wks to fix

    Function from_dict has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

        def from_dict(json, models, decode_primary_objects=True, primary_objects=None, decoded=None, ignore_extra_models=False,
                      validate=False, output_format=None):
            """ Decode a simple Python representation (dict, list, str, float, bool, None) of an object that
            is compatible with JSON and YAML, including references to objects through :obj:`__id` keys.
    
    
    Severity: Minor
    Found in obj_tables/core.py - About 1 day 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_attr_tuples has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate_attr_tuples(metacls, name, bases, namespace, meta_attribute_name):
            """ Validate a tuple of tuples of attribute names
    
            Args:
                meta_attribute_name (:obj:`str`): the name of the attribute to validate and normalize
    Severity: Minor
    Found in obj_tables/core.py - About 1 day 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

    Model has 62 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Model(object, metaclass=ModelMeta):
        """ Base object model
    
        Attributes:
            _source (:obj:`ModelSource`): file location, worksheet, column, and row where the object was defined
    Severity: Major
    Found in obj_tables/core.py - About 1 day to fix

      Function to_dict has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_dict(object, models=None, encode_primary_objects=True, encoded=None):
              """ Encode a instance of :obj:`Model` or a collection of instances of :obj:`Model` using a simple Python representation
              (dict, list, str, float, bool, None) that is compatible with JSON and YAML. Use :obj:`__id` keys to avoid infinite recursion
              by encoding each object once and referring to objects by their __id for each repeated reference.
      
      
      Severity: Minor
      Found in obj_tables/core.py - About 1 day 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 difference has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

          def difference(self, other, tol=0.):
              """ Get the semantic difference between two models
      
              Args:
                  other (:obj:`Model`): other :obj:`Model`
      Severity: Minor
      Found in obj_tables/core.py - About 7 hrs 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_from_cell has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

          def deserialize_from_cell(self, values, objects, decoded=None):
              """ Deserialize value from cell
      
              Args:
                  values (:obj:`str`): String representation
      Severity: Minor
      Found in obj_tables/core.py - About 7 hrs 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 _tree_str has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

          def _tree_str(self, printed_objs, depth, max_depth):
              """ Obtain a nested list of string representations of this Model.
      
                  Follows the graph of related :obj:`Model`'s up to a depth of :obj:`max_depth`. Called recursively.
      
      
      Severity: Minor
      Found in obj_tables/core.py - About 6 hrs 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 _render_difference has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

          def _render_difference(self, difference):
              """ Generate string representation of difference data structure
      
              Args:
                  difference (:obj:`dict`): representation of the semantic difference between two objects
      Severity: Minor
      Found in obj_tables/core.py - About 6 hrs 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 _simplify_difference has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
      Open

          def _simplify_difference(self, difference):
              """ Simplify difference data structure
      
              Args:
                  difference (:obj:`dict`): representation of the semantic difference between two objects
      Severity: Minor
      Found in obj_tables/core.py - About 6 hrs 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 32 (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 4 hrs 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_related_attributes has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          def validate_related_attributes(metacls, name, bases, namespace):
              """ Check the related attributes
      
              Raises:
                  :obj:`ValueError`: if an :obj:`OneToManyAttribute` or :obj:`ManyToOneAttribute` has a :obj:`related_name`
      Severity: Minor
      Found in obj_tables/core.py - About 4 hrs 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 is_equal has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          def is_equal(self, other, tol=0.):
              """ Determine whether two models are semantically equal
      
              Args:
                  other (:obj:`Model`): object to compare
      Severity: Minor
      Found in obj_tables/core.py - About 4 hrs 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 are_related_attributes_serializable has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          def are_related_attributes_serializable(cls):
              """ Determine if the immediate related attributes of the class can be serialized
      
              Returns:
                  :obj:`bool`: :obj:`True` if the related attributes can be serialized
      Severity: Minor
      Found in obj_tables/core.py - About 4 hrs 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 32 (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 4 hrs 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_unique has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          def validate_unique(cls, objects):
              """ Validate attribute uniqueness
      
              Args:
                  objects (:obj:`list` of :obj:`Model`): list of objects
      Severity: Minor
      Found in obj_tables/core.py - About 4 hrs 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 normalize has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          def normalize(self):
              """ Normalize an object into a canonical form. Specifically, this method sorts the RelatedManagers
              into a canonical order because their order has no semantic meaning. Importantly, this canonical form
              is reproducible. Thus, this canonical form facilitates reproducible computations on top of :obj:`Model`
              objects.
      Severity: Minor
      Found in obj_tables/core.py - About 4 hrs 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 index has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          def index(self, *args, **kwargs):
              """ Get related object index by attribute/value pairs
      
              Args:
                  *args (:obj:`Model`): object to find
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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 is_serializable has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          def is_serializable(cls):
              """ Determine if the class (and its related classes) can be serialized
      
              Raises:
                  :obj:`bool`: :obj:`True` if the class can be serialized
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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 serialize_to_cell has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def serialize_to_cell(self, values, encoded=None):
              """ Serialize related object
      
              Args:
                  values (:obj:`list` of :obj:`Model`): Python representation
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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 are_attr_paths_equal has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def are_attr_paths_equal(cls, attr_path, other_attr_path):
              """ Determine if two attribute paths are semantically equal
      
              Args:
                  attr_path (:obj:`list` of :obj:`list` of :obj:`object`):
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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_related has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_related(self, forward=True, reverse=True):
              """ Get all related objects reachable from :obj:`self`
      
              Args:
                  forward (:obj:`bool`, optional): if :obj:`True`, get all forward related objects
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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_all_attrs has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def _generate_normalize_sort_key_all_attrs(cls, processed_models=None):
              """ Generate a key for sorting models by all of their attributes into a normalized order. This method should
              be used for models which do not have unique attributes or sets of unique attributes.
      
              Args:
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
      Open

          def deserialize(self, values, objects, decoded=None):
              """ Deserialize value
      
              Args:
                  values (:obj:`object`): String representation
      Severity: Minor
      Found in obj_tables/core.py - About 3 hrs 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_related_attributes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def init_related_attributes(cls, model_cls):
              """ Initialize related attributes """
              for attr in model_cls.Meta.attributes.values():
                  if isinstance(attr, RelatedAttribute):
      
      
      Severity: Minor
      Found in obj_tables/core.py - About 2 hrs 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 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def deserialize(self, values, objects, decoded=None):
              """ Deserialize value
      
              Args:
                  values (:obj:`object`): String representation
      Severity: Minor
      Found in obj_tables/core.py - About 2 hrs 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 cut_relations has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def cut_relations(self, objs_to_keep=None):
              """ Cut relations to objects not in :obj:`objs`.
      
              Args:
                  objs_to_keep (:obj:`set` of :obj:`Model`, optional): objects to retain relations to
      Severity: Minor
      Found in obj_tables/core.py - About 2 hrs 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 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, enum_class, none=False, default=None, default_cleaned_value=None, none_value=None, verbose_name='', description='',
                       primary=False, unique=False, unique_case_insensitive=False):
              """
              Args:
                  enum_class (:obj:`type` or :obj:`list`): subclass of :obj:`Enum`, :obj:`list` of enumerated names,
      Severity: Minor
      Found in obj_tables/core.py - About 2 hrs 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 __new__ has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def __new__(metacls, name, bases, namespace):
              """
              Args:
                  metacls (:obj:`Model`): :obj:`Model`, or a subclass of :obj:`Model`
                  name (:obj:`str`): :obj:`Model` class name
      Severity: Minor
      Found in obj_tables/core.py - About 2 hrs 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 19 (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 2 hrs 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 19 (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 2 hrs 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 19 (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 2 hrs 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

      Manager has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Manager(object):
          """ Enable O(1) dictionary-based searching of a Model's instances
      
          This class is inspired by Django's :obj:`Manager` class. An instance of :obj:`Manger` is associated with
          each :obj:`Model` and accessed as the class attribute :obj:`objects` (as in Django).
      Severity: Minor
      Found in obj_tables/core.py - About 2 hrs to fix

        Function copy has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            def copy(self):
                """ Create a copy
        
                Returns:
                    :obj:`Model`: model copy
        Severity: Minor
        Found in obj_tables/core.py - About 2 hrs 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_attributes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            def validate_attributes(metacls, name, bases, namespace):
                """ Validate attribute values
        
                Raises:
                    :obj:`ValueError`: if attributes are not valid
        Severity: Minor
        Found in obj_tables/core.py - About 2 hrs 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 is_equal has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            def is_equal(self, other, tol=0.):
                if self.__class__ != other.__class__:
                    return False
        
                min_eq = self.min.__class__ == other.min.__class__ and (
        Severity: Minor
        Found in obj_tables/core.py - About 2 hrs 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 _is_equal_attributes has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def _is_equal_attributes(self, other, tol=0.):
                """ Determine if the attributes of two objects are semantically equal
        
                Args:
                    other (:obj:`Model`): object to compare
        Severity: Minor
        Found in obj_tables/core.py - About 2 hrs 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 17 (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 2 hrs 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_keys has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def _generate_normalize_sort_keys(cls):
                """ Generates keys for sorting the class """
                generated_keys = []
                keys_to_generate = [cls]
                while keys_to_generate:
        Severity: Minor
        Found in obj_tables/core.py - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, _comments=None, **kwargs):
                """
                Args:
                    **kwargs: dictionary of keyword arguments with keys equal to the names of the model attributes
        
        
        Severity: Minor
        Found in obj_tables/core.py - About 2 hrs 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

        Consider simplifying this complex logical expression.
        Open

                    if (include is None or (value in include or
                                            (include_nan
                                             and (isinstance(value, numbers.Number)
                                                  and isnan(value))))) and \
                       (exclude is None or (value not in exclude
        Severity: Critical
        Found in obj_tables/core.py - About 2 hrs to fix

          Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, related_class, related_name='', default=list(), default_cleaned_value=list(),
          Severity: Major
          Found in obj_tables/core.py - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                    if (callable(default) or
                            (isinstance(default, list) and len(default) > 0) or
                            (not isinstance(default, list) and default is not None)) and \
                        (callable(related_default) or
                            (isinstance(related_default, list) and len(related_default) > 0) or
            Severity: Critical
            Found in obj_tables/core.py - About 2 hrs to fix

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

                  def related_validate(self, obj, value):
                      """ Determine if :obj:`value` is a valid value of the related 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 clean has a Cognitive Complexity of 15 (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 related_validate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def related_validate(self, obj, value):
                      """ Determine if :obj:`value` is a valid value of the related 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_xlsx_validation has a Cognitive Complexity of 15 (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 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 15 (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 related_validate has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def related_validate(self, obj, value):
                      """ Determine if :obj:`value` is a valid value of the related 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 __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, related_class, related_name='', default=list(), default_cleaned_value=list(),
              Severity: Major
              Found in obj_tables/core.py - About 1 hr to fix

                Function __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, related_class, related_name='',
                Severity: Major
                Found in obj_tables/core.py - About 1 hr to fix

                  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_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 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 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 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 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_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 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 __init__ has 13 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(self, related_class, related_name='',
                  Severity: Major
                  Found in obj_tables/core.py - About 1 hr to fix

                    Function get_immediate_children has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def get_immediate_children(self, kind=None, __type=None, **kwargs):
                            """ Get a kind of immediate 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 __init__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __init__(self, related_class, related_name='',
                                     init_value=None, default=None, default_cleaned_value=None, none_value=None,
                                     related_init_value=None, related_default=None,
                                     min_related=0, max_related=float('inf'), min_related_rev=0, max_related_rev=float('inf'),
                                     verbose_name='', verbose_related_name='', description=''):
                    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 13 (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 init_attributes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def init_attributes(cls):
                            """ Initialize attributes """
                    
                            cls.Meta.attributes = collections.OrderedDict()
                            for attr_name in sorted(dir(cls)):
                    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 12 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, pattern, flags=0, min_length=0, max_length=None,
                    Severity: Major
                    Found in obj_tables/core.py - About 1 hr to fix

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

                          def validate_attribute_inheritance(metacls, name, bases, namespace):
                              """ Check attribute inheritance
                      
                              Raises:
                                  :obj:`ValueError`: if subclass overrides a superclass attribute (instance of Attribute) with an incompatible
                      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 12 (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_attrs_by_val has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def get_attrs_by_val(self, type=None, reverse=True,
                                               include=None, exclude=None):
                              """ Get attributes whose type is :obj:`type` and values are
                              in :obj:`include` and not :obj:`exclude`, optionally including attributes
                              from related classes. By default, get all attributes.
                      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 11 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, min_length=0, max_length=255, none=False, default='', default_cleaned_value='', none_value='',
                      Severity: Major
                      Found in obj_tables/core.py - About 1 hr to fix

                        Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, min_length=0, max_length=2**32 - 1, none=False, default='', default_cleaned_value='', none_value='',
                        Severity: Major
                        Found in obj_tables/core.py - About 1 hr to fix

                          Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, related_class, related_name='',
                          Severity: Major
                          Found in obj_tables/core.py - About 1 hr to fix

                            Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(self, enum_class, none=False, default=None, default_cleaned_value=None, none_value=None, verbose_name='', description='',
                            Severity: Major
                            Found in obj_tables/core.py - About 1 hr to fix

                              Function gen_merge_map has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def gen_merge_map(self, other):
                                      """ Create a dictionary that maps instances of objects in another model to objects
                                      in a model
                              
                                      Args:
                              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 10 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(self, min=float('nan'), max=float('nan'), nan=True,
                              Severity: Major
                              Found in obj_tables/core.py - About 1 hr to fix

                                Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self, min=None, max=None, none=False, default=None, default_cleaned_value=None,
                                Severity: Major
                                Found in obj_tables/core.py - About 1 hr to fix

                                  Function get_xlsx_validation has a Cognitive Complexity of 11 (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 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 11 (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_xlsx_validation has a Cognitive Complexity of 11 (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 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 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def validate(self, obj, value):
                                          """ Determine if :obj:`value` is a valid value for this StringAttribute
                                  
                                          Args:
                                              obj (:obj:`Model`): class 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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def __init__(self, max=None, none=False, default=None, default_cleaned_value=None,
                                  Severity: Major
                                  Found in obj_tables/core.py - About 1 hr to fix

                                    Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __init__(self, init_value=None, default=None, default_cleaned_value=None, none_value=None, verbose_name='', description='',
                                    Severity: Major
                                    Found in obj_tables/core.py - About 1 hr to fix

                                      Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def __init__(self, max=float('nan'), nan=True, default=float('nan'), default_cleaned_value=float('nan'),
                                      Severity: Major
                                      Found in obj_tables/core.py - About 1 hr to fix

                                        Function get_all_related has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def get_all_related(objs, forward=True, reverse=True):
                                                """ Optimally obtain all objects related to objects in :obj:`objs`
                                        
                                                The set of all :obj:`Model`\ s can be viewed as a graph whose nodes are :obj:`Model` instances
                                                and whose edges are related connections. Because related edges are bi-directional, this graph
                                        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 10 (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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def validate(self):
                                                """ Determine if the object is valid
                                        
                                                Returns:
                                                    :obj:`InvalidObject` or None: :obj:`None` if the object is valid,
                                        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 has_attr_vals has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            def has_attr_vals(self, __type=None, __check_attr_defined=True, **kwargs):
                                                """ Check if the type and values of the attributes of an object match a set of conditions
                                        
                                                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 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 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            def __init__(self, none=True, default=None, default_cleaned_value=None, none_value=None,
                                        Severity: Major
                                        Found in obj_tables/core.py - About 1 hr to fix

                                          Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              def __init__(self, verbose_name='', description='Enter a path to a local file or directory',
                                          Severity: Major
                                          Found in obj_tables/core.py - About 1 hr to fix

                                            Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                def __init__(self, type=float, separator='-', separator_pattern=r'(?<!e) *- *',
                                            Severity: Major
                                            Found in obj_tables/core.py - About 1 hr to fix

                                              Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                  def __init__(self, none=True, default=None, default_cleaned_value=None, none_value=None,
                                              Severity: Major
                                              Found in obj_tables/core.py - About 1 hr to fix

                                                Function from_dict has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                    def from_dict(json, models, decode_primary_objects=True, primary_objects=None, decoded=None, ignore_extra_models=False,
                                                Severity: Major
                                                Found in obj_tables/core.py - About 1 hr to fix

                                                  Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      def __init__(self, none=True, default=None, default_cleaned_value=None, none_value=None,
                                                  Severity: Major
                                                  Found in obj_tables/core.py - About 1 hr to fix

                                                    Consider simplifying this complex logical expression.
                                                    Open

                                                                            if isinstance(attr, (
                                                                                OneToOneAttribute,
                                                                                OneToManyAttribute,
                                                                                ManyToOneAttribute,
                                                                                ManyToManyAttribute)) and \
                                                    Severity: Major
                                                    Found in obj_tables/core.py - About 1 hr to fix

                                                      Function set_nested_attr_val has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def set_nested_attr_val(self, attr_path, value):
                                                              """ Set the value of an attribute or a nested attribute of a model
                                                      
                                                              Args:
                                                                  attr_path (:obj:`list` of :obj:`list` of :obj:`object`):
                                                      Severity: Minor
                                                      Found in obj_tables/core.py - About 55 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 validate has a Cognitive Complexity of 9 (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 55 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 9 (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 55 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 9 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def __init__(self, min_length=0, max_length=255, none=False, default='', default_cleaned_value='', none_value='',
                                                                       verbose_name='', description='',
                                                                       primary=False, unique=False, unique_case_insensitive=False):
                                                              """
                                                              Args:
                                                      Severity: Minor
                                                      Found in obj_tables/core.py - About 55 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 related_validate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                          def related_validate(self, obj, value):
                                                              """ Determine if :obj:`value` is a valid value of the related attribute
                                                      
                                                              Args:
                                                                  obj (:obj:`Model`): object being validated
                                                      Severity: Minor
                                                      Found in obj_tables/core.py - About 55 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 9 (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 55 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 split_separated_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                      Open

                                                      def split_separated_list(joined_values, separator=','):
                                                          """ Parse a separator list of values into a list of values
                                                      
                                                          Args:
                                                              joined_values (:obj:`str`): seperator-separated list of values
                                                      Severity: Minor
                                                      Found in obj_tables/core.py - About 55 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 validate has a Cognitive Complexity of 8 (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 45 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_source has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                          def set_source(self, path_name, sheet_name, attribute_seq, row, table_id=None):
                                                      Severity: Minor
                                                      Found in obj_tables/core.py - About 45 mins to fix

                                                        Function __init__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            def __init__(self, min=None, max=None, none=False, default=None, default_cleaned_value=None,
                                                                         none_value=None, verbose_name='', description='', primary=False, unique=False):
                                                                """
                                                                Args:
                                                                    min (:obj:`int`, optional): minimum value
                                                        Severity: Minor
                                                        Found in obj_tables/core.py - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            def __init__(self, type=str, separator=',', default=[], none_value=[], verbose_name='',
                                                        Severity: Minor
                                                        Found in obj_tables/core.py - About 45 mins to fix

                                                          Function set_related_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def set_related_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 45 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 merge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              def merge(self, other, normalize=True, validate=True):
                                                                  """ Merge another model into a model
                                                          
                                                                  Args:
                                                                      other (:obj:`Model`): other model
                                                          Severity: Minor
                                                          Found in obj_tables/core.py - About 45 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 8 (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 45 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 8 (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 45 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 validate has a Cognitive Complexity of 8 (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 45 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 clean has a Cognitive Complexity of 8 (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 45 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 validate has a Cognitive Complexity of 8 (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/core.py - About 45 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 deeply nested control flow statements.
                                                          Open

                                                                                  if '.' not in related_class_name:
                                                                                      related_class_name = model.__module__ + '.' + related_class_name
                                                                              else:
                                                          Severity: Major
                                                          Found in obj_tables/core.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                    if isinstance(attr, (
                                                                                        OneToOneAttribute,
                                                                                        OneToManyAttribute,
                                                                                        ManyToOneAttribute,
                                                                                        ManyToManyAttribute)) and \
                                                            Severity: Major
                                                            Found in obj_tables/core.py - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      if isinstance(val, list):
                                                                                          objs_to_normalize.extend(val)
                                                                                      elif val:
                                                                                          objs_to_normalize.append(val)
                                                              
                                                              
                                                              Severity: Major
                                                              Found in obj_tables/core.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        for i_val2 in range(i_val, len(val)):
                                                                                            difference['attributes'][attr_name].append(
                                                                                                'No matching element {}'.format(serial_vals[i_val2][0]))
                                                                                elif val is None:
                                                                Severity: Major
                                                                Found in obj_tables/core.py - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                          if new_to_msg:
                                                                                              msg += prefix + new_to_msg
                                                                                              prefix = ''
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in obj_tables/core.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            if v:
                                                                                                if isinstance(v, dict):
                                                                                                    new_to_flatten.append(diff_hierarchy + [v])
                                                                                            else:
                                                                                                val.remove(v)
                                                                    Severity: Major
                                                                    Found in obj_tables/core.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                              if attr_name in cls.Meta.attributes:
                                                                                                  other_cls = attr.related_class
                                                                                              else:
                                                                                                  other_cls = attr.primary_class
                                                                      
                                                                      
                                                                      Severity: Major
                                                                      Found in obj_tables/core.py - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                if attr_name not in Meta.attribute_order:
                                                                                                    Meta.attribute_order.append(attr_name)
                                                                                    Meta.attribute_order = tuple(Meta.attribute_order)
                                                                        Severity: Major
                                                                        Found in obj_tables/core.py - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                  if v not in objs_to_keep:
                                                                                                      val.remove(v)
                                                                                          else:
                                                                          Severity: Major
                                                                          Found in obj_tables/core.py - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    if '__module__' in namespace and related_class_name == namespace['__module__'] + '.' + name:
                                                                                                        attribute_names.append(attr.related_name)
                                                                                                    else:
                                                                                                        for base in bases:
                                                                                                            if related_class_name == base.__module__ + '.' + base.__name__:
                                                                            Severity: Major
                                                                            Found in obj_tables/core.py - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                      if new_to_render:
                                                                                                          new_to_render[0][2] = prefix + new_to_render[0][2]
                                                                                                          new_to_render.reverse()
                                                                                                          to_render.extend(new_to_render)
                                                                                                  else:
                                                                              Severity: Major
                                                                              Found in obj_tables/core.py - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                        if attr_json is None:
                                                                                                            attr_val = None
                                                                                
                                                                                                        elif isinstance(attr_json, list):
                                                                                                            attr_val = []
                                                                                Severity: Major
                                                                                Found in obj_tables/core.py - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                          for oo in getattr(o, attr_name):
                                                                                                              objs[attr.related_class][oo.serialize()] = oo
                                                                                  
                                                                                  
                                                                                  Severity: Major
                                                                                  Found in obj_tables/core.py - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                            if metacls.CHECK_SAME_RELATED_ATTRIBUTE_NAME and \
                                                                                                                    attr.related_name in related_class.Meta.related_attributes and \
                                                                                                                    related_class.Meta.related_attributes[attr.related_name] is not attr:
                                                                                                                other_attr = related_class.Meta.related_attributes[
                                                                                                                    attr.related_name]
                                                                                    Severity: Major
                                                                                    Found in obj_tables/core.py - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                              if val.__class__ != other_val.__class__:
                                                                                                                  return False
                                                                                      
                                                                                      
                                                                                      Severity: Major
                                                                                      Found in obj_tables/core.py - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                if attr.is_related_to_many:
                                                                                                                    getattr(existing_deserialized_value, attr.name).extend(getattr(deserialized_value, attr.name, []))
                                                                                                                    setattr(deserialized_value, attr.name, [])
                                                                                                                elif attr.is_related:
                                                                                                                    related_val = getattr(deserialized_value, attr.name)
                                                                                        Severity: Major
                                                                                        Found in obj_tables/core.py - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                                  if isinstance(val, list) and len(val) > 1:
                                                                                                                      if attr_name in obj.Meta.attributes:
                                                                                                                          cls = attr.related_class
                                                                                                                      else:
                                                                                                                          cls = attr.primary_class
                                                                                          Severity: Major
                                                                                          Found in obj_tables/core.py - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                    if isinstance(attr, RelatedAttribute):
                                                                                                                        if val is None:
                                                                                                                            json_val = None
                                                                                                                        elif isinstance(val, list):
                                                                                                                            json_val = []
                                                                                            Severity: Major
                                                                                            Found in obj_tables/core.py - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                      while i_val < len(val) and oi_val < len(other_val):
                                                                                                                          serial_v = serial_vals[i_val][0]
                                                                                                                          serial_ov = serial_other_vals[oi_val][0]
                                                                                                                          if serial_v == serial_ov:
                                                                                                                              el_diff = {}
                                                                                              Severity: Major
                                                                                              Found in obj_tables/core.py - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        if isinstance(value, list):
                                                                                                                            objs_to_explore.extend(value)
                                                                                                                        elif value is not None:
                                                                                                                            objs_to_explore.append(value)
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in obj_tables/core.py - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                          if v not in printed_objs:
                                                                                                                              iter_attr.append(v._tree_str(
                                                                                                                                  printed_objs, depth + 1, max_depth))
                                                                                                                      attrs.extend(iter_attr)
                                                                                                  Severity: Major
                                                                                                  Found in obj_tables/core.py - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                            if attr.related_name in related_class.Meta.attributes and \
                                                                                                                                    not (isinstance(attr, (OneToOneAttribute, ManyToManyAttribute)) and attr.related_name == attr_name):
                                                                                                                                other_attr = related_class.Meta.attributes[
                                                                                                                                    attr.related_name]
                                                                                                                                raise ValueError('Related attribute {}.{} cannot use the same related name as {}.{}'.format(
                                                                                                    Severity: Major
                                                                                                    Found in obj_tables/core.py - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                              if val is None:
                                                                                                                                  pass
                                                                                                                              elif isinstance(val, Model):
                                                                                                                                  pairs_to_check.append((val, other_val, ))
                                                                                                                              elif len(val) != len(other_val):
                                                                                                      Severity: Major
                                                                                                      Found in obj_tables/core.py - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                for i_el, el_diff in enumerate(difference['attributes'][attr_name]):
                                                                                                                                    if isinstance(el_diff, dict):
                                                                                                                                        el_prefix = '\n{}element: {}: "{}" != element: {}: "{}"'.format(
                                                                                                                                            ' ' * 2 * (indent + 2),
                                                                                                                                            el_diff['objects'][0].__class__.__name__,
                                                                                                        Severity: Major
                                                                                                        Found in obj_tables/core.py - About 45 mins to fix

                                                                                                          Function get_attrs_by_val has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                              def get_attrs_by_val(self, type=None, reverse=True,
                                                                                                          Severity: Minor
                                                                                                          Found in obj_tables/core.py - About 35 mins to fix

                                                                                                            Function add_to_decoding_queue has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                                    def add_to_decoding_queue(json, models_by_name=models_by_name, decoded=decoded, to_decode=to_decode,
                                                                                                            Severity: Minor
                                                                                                            Found in obj_tables/core.py - About 35 mins to fix

                                                                                                              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                                  def __init__(self, path_name, sheet_name, attribute_seq, row, table_id=None):
                                                                                                              Severity: Minor
                                                                                                              Found in obj_tables/core.py - About 35 mins to fix

                                                                                                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                    def __init__(self, attribute, messages, related=False, location=None, value=None):
                                                                                                                Severity: Minor
                                                                                                                Found in obj_tables/core.py - About 35 mins to fix

                                                                                                                  Function get_children has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                      def get_children(self, kind=None, __type=None, recursive=True, **kwargs):
                                                                                                                  Severity: Minor
                                                                                                                  Found in obj_tables/core.py - About 35 mins to fix

                                                                                                                    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                    Open

                                                                                                                        def __init__(self, default=False, default_cleaned_value=None, none_value=None, verbose_name='', description='Enter a Boolean value'):
                                                                                                                    Severity: Minor
                                                                                                                    Found in obj_tables/core.py - About 35 mins to fix

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

                                                                                                                          def clean(self, value):
                                                                                                                              """ Deserialize value
                                                                                                                      
                                                                                                                              Args:
                                                                                                                                  value (:obj:`str`): semantically equivalent representation
                                                                                                                      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_hashable_values has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                          def _get_hashable_values(values):
                                                                                                                              """ Provide hashable values for a tuple of values of a :obj:`Model`'s attributes
                                                                                                                      
                                                                                                                              Args:
                                                                                                                                  values (:obj:`tuple`): values of :obj:`Model` attributes
                                                                                                                      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 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 validate_unique has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                          def validate_unique(self, objects, values):
                                                                                                                              """ Determine if the attribute values are unique
                                                                                                                      
                                                                                                                              Args:
                                                                                                                                  objects (:obj:`list` of :obj:`Model`): list of :obj:`Model` 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

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                          return (datetime_value.date(), None)
                                                                                                                      Severity: Major
                                                                                                                      Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                            return False
                                                                                                                        Severity: Major
                                                                                                                        Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                          return (value, InvalidAttribute(self, ['String must be a valid date']))
                                                                                                                          Severity: Major
                                                                                                                          Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                    return (value, InvalidAttribute(self, ['Value must be an instance of `datetime`']))
                                                                                                                            Severity: Major
                                                                                                                            Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                      return (value, InvalidAttribute(self, ['Value must be an instance of `date`']))
                                                                                                                              Severity: Major
                                                                                                                              Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                            return (time(hour, minutes, seconds), None)
                                                                                                                                Severity: Major
                                                                                                                                Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                                      return False
                                                                                                                                  Severity: Major
                                                                                                                                  Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                                return (None, InvalidAttribute(self, ['Multiple matching objects with primary attribute = {}'.format(value)]))
                                                                                                                                    Severity: Major
                                                                                                                                    Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                          return (value, InvalidAttribute(self, ['Time must be 0:0:0.0']))
                                                                                                                                      Severity: Major
                                                                                                                                      Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                        return (value, InvalidAttribute(self, ['Number must be a valid time']))
                                                                                                                                        Severity: Major
                                                                                                                                        Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                                      return (None, InvalidAttribute(self, ['Unable to deserialize an instance of {}'.format(value.__class__.__name__)]))
                                                                                                                                          Severity: Major
                                                                                                                                          Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                        return (None, InvalidAttribute(self, ['Unable to deserialize an instance of {}'.format(value.__class__.__name__)]))
                                                                                                                                            Severity: Major
                                                                                                                                            Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                              return (date.fromordinal(int_value + date(1900, 1, 1).toordinal() - 1), None)
                                                                                                                                              Severity: Major
                                                                                                                                              Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                                return (value, InvalidAttribute(self, ['String must be a valid time']))
                                                                                                                                                Severity: Major
                                                                                                                                                Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                          return (value, InvalidAttribute(self, ['Value must be an instance of `time`']))
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                                            return False
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                      return (value, InvalidAttribute(self, ['String must be a valid datetime']))
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                return True
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                      return (None, InvalidAttribute(self, ['Multiple matching objects with primary attribute = {}'.format(value)]))
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                        return (datetime.combine(date_value, time_value), None)
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                      return True
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in obj_tables/core.py - About 30 mins to fix

                                                                                                                                                                Function _dump_index_dicts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def _dump_index_dicts(self, file=None):
                                                                                                                                                                        """ Dump the index dictionaries for debugging
                                                                                                                                                                
                                                                                                                                                                        Args:
                                                                                                                                                                            file (:obj:`object`, optitonal): an object with a :obj:`write(string)` method
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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 clean has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def clean(self, value):
                                                                                                                                                                        """ Deserialize value
                                                                                                                                                                
                                                                                                                                                                        Args:
                                                                                                                                                                            value (:obj:`str`): semantically equivalent representation
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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 validate has a Cognitive Complexity of 6 (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 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 _gc_weaksets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def _gc_weaksets(self):
                                                                                                                                                                        """ Garbage collect empty WeakSets formed by deletion of weak refs to :obj:`Model` instances with no strong refs
                                                                                                                                                                
                                                                                                                                                                        Returns:
                                                                                                                                                                            :obj:`int`: number of empty WeakSets deleted
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def __init__(self, min=float('nan'), max=float('nan'), nan=True,
                                                                                                                                                                                 default=float('nan'), default_cleaned_value=float('nan'), none_value=float('nan'), verbose_name='', description='',
                                                                                                                                                                                 primary=False, unique=False):
                                                                                                                                                                        """
                                                                                                                                                                        Args:
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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 value_equal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def value_equal(self, val1, val2, tol=0.):
                                                                                                                                                                        """ Determine if attribute values are equal, optionally,
                                                                                                                                                                        up to a tolerance
                                                                                                                                                                
                                                                                                                                                                        Args:
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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 _parse_attr_path_el has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def _parse_attr_path_el(cls, attr):
                                                                                                                                                                        """ Parse an element of a path to a nested attribute
                                                                                                                                                                
                                                                                                                                                                        Args:
                                                                                                                                                                            attr (:obj:`list` of :obj:`dict`): an element of a path to a nested attribute
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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 _delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                    def _delete(self, model_obj):
                                                                                                                                                                        """ Delete an :obj:`model_obj` from the indices
                                                                                                                                                                
                                                                                                                                                                        Args:
                                                                                                                                                                            model_obj (:obj:`Model`): a :obj:`Model` instance
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in obj_tables/core.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

                                                                                                                                                                There are no issues that match your filters.

                                                                                                                                                                Category
                                                                                                                                                                Status