Function prepare_data
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def prepare_data(self, row, line_num):
data = {}
test_error = False
machine_id = self.attendance_machine_id
- 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
File hr_attendance_import.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import base64
import csv
Function get_name_data
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_name_data(
Function get_csv_detail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_csv_detail(self):
dict_field = {}
dict_date = {}
obj_csv_detail = self.env["hr.attendance_machine_csv_detail"]
- 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_sign_in_out
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_sign_in_out(self, row, column, line_num, sign_in_code, sign_out_code):
Function check_datetime
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def check_datetime(self, row, date_format, time_format, column, line_num):
Function button_import
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def button_import(self):
self.ensure_one()
obj_hr_attendance = self.env["hr.attendance"]
- 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"