OCA/openupgradelib

View on GitHub

Showing 119 of 160 total issues

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

def _check_recurrence(env, model_name, record_ids, target_record_id, model_table=None):
Severity: Minor
Found in openupgradelib/openupgrade_merge_records.py - About 35 mins to fix

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

    def convert_to_company_dependent(
    Severity: Minor
    Found in openupgradelib/openupgrade.py - About 35 mins to fix

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

      def set_defaults(cr, pool, default_spec, force=False, use_orm=False):
      Severity: Minor
      Found in openupgradelib/openupgrade.py - About 35 mins to fix

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

        def _change_many2many_refs_orm(
        Severity: Minor
        Found in openupgradelib/openupgrade_merge_records.py - About 35 mins to fix

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

          def _change_reference_refs_orm(
          Severity: Minor
          Found in openupgradelib/openupgrade_merge_records.py - About 35 mins to fix

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

            def load_data(env_or_cr, module_name, filename, idref=None, mode="init"):
            Severity: Minor
            Found in openupgradelib/openupgrade.py - About 35 mins to fix

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

              def _change_reference_refs_sql(
              Severity: Minor
              Found in openupgradelib/openupgrade_merge_records.py - About 35 mins to fix

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

                def convert_old_style_tax_tag_to_new(
                Severity: Minor
                Found in openupgradelib/openupgrade_130.py - About 35 mins to fix

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

                  def m2o_to_x2m(cr, model, table, field, source_field):
                  Severity: Minor
                  Found in openupgradelib/openupgrade.py - About 35 mins to fix

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

                    def convert_field_bootstrap_3to4(
                    Severity: Minor
                    Found in openupgradelib/openupgrade_120.py - About 35 mins to fix

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

                      def convert_field_bootstrap_4to5(
                      Severity: Minor
                      Found in openupgradelib/openupgrade_160.py - About 35 mins to fix

                        Function warn_possible_dataloss has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def warn_possible_dataloss(cr, pool, old_module, fields):
                            """
                            Use that function in the following case:
                            if a field of a model was moved from a 'A' module to a 'B' module.
                            ('B' depend on 'A'),
                        Severity: Minor
                        Found in openupgradelib/openupgrade.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 _check_recurrence has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def _check_recurrence(env, model_name, record_ids, target_record_id, model_table=None):
                            if not model_table:
                                try:
                                    model_table = env[model_name]._table
                                except KeyError:
                        Severity: Minor
                        Found in openupgradelib/openupgrade_merge_records.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 update_field_multilang has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def update_field_multilang(records, field, method):
                            """Update a field in all available languages in the database.
                        
                            :param records:
                                Recordset to be updated.
                        Severity: Minor
                        Found in openupgradelib/openupgrade.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 deactivate_workflow_transitions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def deactivate_workflow_transitions(cr, model, transitions=None):
                            """
                            Disable workflow transitions for workflows on a given model.
                            This can be necessary for automatic workflow transitions when writing
                            to an object via the ORM in the post migration step.
                        Severity: Minor
                        Found in openupgradelib/openupgrade.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 _orderResultsByScoreThenName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const _orderResultsByScoreThenName = (a, b) => {
                          const leftScore = a[4];
                          const rightScore = b[4];
                          if (leftScore === rightScore) {
                            // same score: sort alphabetically
                        Severity: Minor
                        Found in docs/_static/searchtools.js - 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 chunked has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def chunked(records, single=True):
                            """Memory and performance friendly method to iterate over a potentially
                            large number of records. Yields either a whole chunk or a single record
                            at the time. Don't nest calls to this method."""
                            size = core.models.PREFETCH_MAX
                        Severity: Minor
                        Found in openupgradelib/openupgrade.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_transient_models has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def clean_transient_models(cr):
                            """Clean transient models to prevent possible issues due to
                            chained data.
                        
                            To be run at the base pre-migration script for having a general scope.
                        Severity: Minor
                        Found in openupgradelib/openupgrade.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 performTermsSearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          performTermsSearch: (searchTerms, excludedTerms) => {
                            // prepare search
                            const terms = Search._index.terms;
                            const titleTerms = Search._index.titleterms;
                            const filenames = Search._index.filenames;
                        Severity: Minor
                        Found in docs/_static/searchtools.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language