Showing 120 of 163 total issues
Function _change_many2many_refs_orm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _change_many2many_refs_orm(
Function convert_field_bootstrap_4to5
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert_field_bootstrap_4to5(
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"):
Function m2o_to_m2m
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def m2o_to_m2m(cr, model, table, field, source_field):
Function _change_translations_orm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _change_translations_orm(
Function date_to_datetime_tz
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def date_to_datetime_tz(
Function convert_field_bootstrap_3to4
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert_field_bootstrap_3to4(
Function _adjust_merged_values_orm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _adjust_merged_values_orm(
Function update_module_moved_fields
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_module_moved_fields(cr, model, moved_fields, old_module, new_module):
Function convert_to_company_dependent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert_to_company_dependent(
Function _change_many2one_refs_orm
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _change_many2one_refs_orm(
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):
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.
- Read upRead up
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 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'),
- Read upRead up
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:
- Read upRead up
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.
- Read upRead up
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;
- Read upRead up
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
- Read upRead up
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.
- Read upRead up
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
- Read upRead up
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"