KarrLab/obj_tables

View on GitHub

Showing 425 of 542 total issues

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

            def write_toc(self, writer, models, schema_name, date, doc_metadata, grouped_objects, write_schema=False, protected=True):
                """ Write a worksheet with a table of contents
        
                Args:
                    writer (:obj:`wc_utils.workbook.io.Writer`): io writer
        Severity: Minor
        Found in obj_tables/io.py - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            def read_model(self, reader, sheet_name, schema_name, model, include_all_attributes=True,
        Severity: Major
        Found in obj_tables/io.py - About 1 hr to fix

          Function run has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def run():
              #########################
              # import schema
              import schema as address_book
              PersonType = address_book.Person.type.enum_class
          Severity: Minor
          Found in examples/address_book/tutorial.py - About 1 hr to fix

            Function make_data_schema_migration_conf_file_cmd has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def make_data_schema_migration_conf_file_cmd(data_repo_dir, schema_file_url, files_to_migrate,
                                                             add_to_repo=True):
                    """ Make a data-schema migration configuration file from CLI input
            
                    Args:
            Severity: Minor
            Found in obj_tables/migrate.py - About 1 hr to fix

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

                  def __init__(self, none=True, default=None, default_cleaned_value=None,
              Severity: Major
              Found in obj_tables/sci/uncertainty.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=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, 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 write_sheet has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def write_sheet(self, writer, model, data, headings, metadata_headings, validation,
                      Severity: Major
                      Found in obj_tables/io.py - About 1 hr to fix

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

                            def write_sheet(self, writer, model, data, headings, metadata_headings, validation,
                        Severity: Major
                        Found in obj_tables/io.py - About 1 hr to fix

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

                              def migrate_over_schema_sequence(migration_spec):
                                  """ Migrate some model files over a sequence of schemas
                          
                                  Args:
                                      migration_spec (:obj:`MigrationSpec`): a migration specification
                          Severity: Minor
                          Found in obj_tables/migrate.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 _migrate_all_analyzed_exprs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _migrate_all_analyzed_exprs(self, all_models):
                                  """ Migrate all model instances' :obj:`ParsedExpression`\ s
                          
                                  This must be done after all migrated models have been created.
                          
                          
                          Severity: Minor
                          Found in obj_tables/migrate.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

                          Severity
                          Category
                          Status
                          Source
                          Language