OCA/management-system

View on GitHub

Showing 26 of 60 total issues

File mgmtsystem_kpi.py has 455 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#  -*- encoding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2012 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 6 hrs to fix

File mgmtsystem_nonconformity.py has 331 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
Severity: Minor
Found in mgmtsystem_nonconformity/models/mgmtsystem_nonconformity.py - About 3 hrs to fix

Function test_workflow has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def test_workflow(self):

        conf_obj = self.conf_m.create({
            "manager_user_id": self.env.user.id,
            "partner_id": self.partner_obj[0].id,
Severity: Major
Found in mgmtsystem_nonconformity/tests/test_workflows.py - About 2 hrs to fix

Function compute_max_value has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_max_value(self, cr, uid, ids, field_name, arg, context=None):
        if context is None:
            context = {}
        result = {}
        for obj in self.browse(cr, uid, ids, context):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.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 compute_kpi_value has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_kpi_value(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        for obj in self.browse(cr, uid, ids):
            kpi_value = 0
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.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 compute_min_value has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_min_value(self, cr, uid, ids, field_name, arg, context=None):
        if context is None:
            context = {}
        result = {}
        for obj in self.browse(cr, uid, ids):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.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 _is_valid_threshold has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _is_valid_threshold(self, cr, uid, ids, field_name, arg, context=None):
        if context is None:
            context = {}
        result = {}
        for obj in self.browse(cr, uid, ids, context):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.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 create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def create(self, cr, uid, data, context=None):
        if context is None:
            context = {}

        # check if ranges overlap
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.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_lines_by_procedure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_lines_by_procedure(self, verification_lines):
        p = []
        for l in verification_lines:
            if l.procedure_id.id:
                proc_nm = self.pool.get('document.page').read(
Severity: Minor
Found in mgmtsystem_audit/report/verification_list.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 message_auto_subscribe has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def message_auto_subscribe(
Severity: Minor
Found in mgmtsystem_audit/models/mgmtsystem_audit.py - About 45 mins to fix

Function _is_valid_threshold has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _is_valid_threshold(self, cr, uid, ids, field_name, arg, context=None):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix

Function message_auto_subscribe has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def message_auto_subscribe(
Severity: Minor
Found in mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py - About 45 mins to fix

Function _complete_name has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _complete_name(self, cr, uid, ids, name, args, context=None):

Function _display_last_kpi_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _display_last_kpi_value(
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix

Function compute_max_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def compute_max_value(self, cr, uid, ids, field_name, arg, context=None):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix

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

    def get_color(self, cr, uid, ids, kpi_value, context=None):
        if context is None:
            context = {}

        color = '#FFFFFF'
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.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 _generate_invalid_message has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _generate_invalid_message(
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix

Function _is_valid_range has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _is_valid_range(self, cr, uid, ids, field_name, arg, context=None):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix

Function _generate_invalid_message has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _generate_invalid_message(
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix

Function compute_min_value has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def compute_min_value(self, cr, uid, ids, field_name, arg, context=None):
Severity: Minor
Found in mgmtsystem_kpi/mgmtsystem_kpi.py - About 45 mins to fix
Severity
Category
Status
Source
Language