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>).
- Create a ticketCreate a ticket
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>).
- Create a ticketCreate a ticket
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,
- Create a ticketCreate a ticket
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):
- Read upRead up
- Create a ticketCreate a ticket
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
- Read upRead up
- Create a ticketCreate a ticket
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):
- Read upRead up
- Create a ticketCreate a ticket
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):
- Read upRead up
- Create a ticketCreate a ticket
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
- Read upRead up
- Create a ticketCreate a ticket
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(
- Read upRead up
- Create a ticketCreate a ticket
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(
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket
Function message_auto_subscribe
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def message_auto_subscribe(
- Create a ticketCreate a ticket
Function _complete_name
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _complete_name(self, cr, uid, ids, name, args, context=None):
- Create a ticketCreate a ticket
Function _display_last_kpi_value
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _display_last_kpi_value(
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket
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'
- Read upRead up
- Create a ticketCreate a ticket
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(
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket
Function _generate_invalid_message
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _generate_invalid_message(
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket