bmya/odoo-bmya-cl

View on GitHub

Showing 30 of 71 total issues

File invoice.py has 520 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
Severity: Major
Found in l10n_cl_dte/models/invoice.py - About 1 day to fix

    Function l10n_cl_pos_credit_card_voucher has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    openerp.l10n_cl_pos_credit_card_voucher = function(instance){
        var module = instance.point_of_sale;
        var QWeb = instance.web.qweb;
        var _t = instance.web._t;
    
    
    Severity: Minor
    Found in l10n_cl_pos_credit_card_voucher/static/src/js/pos_cc_voucher.js - About 4 hrs 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 do_dte_send_invoice has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def do_dte_send_invoice(self):
            cant_doc_batch = 0
            for inv in self.with_context(lang='es_CL'):
                # control de DTE
                if inv.sii_document_class_id.dte == False:
    Severity: Minor
    Found in l10n_cl_dte/models/invoice.py - About 3 hrs 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 l10n_cl_pos_credit_card_voucher has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    openerp.l10n_cl_pos_credit_card_voucher = function(instance){
        var module = instance.point_of_sale;
        var QWeb = instance.web.qweb;
        var _t = instance.web._t;
    
    
    Severity: Major
    Found in l10n_cl_pos_credit_card_voucher/static/src/js/pos_cc_voucher.js - About 3 hrs to fix

      File invoice.py has 304 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      from openerp import osv, models, fields, api, _
      from openerp.osv import fields as old_fields
      from openerp.exceptions import except_orm, Warning
      from openerp.addons import decimal_precision as dp
      Severity: Minor
      Found in l10n_cl_invoice/models/invoice.py - About 3 hrs to fix

        Function create_journal_document has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def create_journal_document(self, cr, uid, letter_ids, document_type,
                                        journal_id, wz, context=None):
        
                print(document_type, letter_ids)
                if_zf = [] if wz.free_tax_zone else [901, 906, 907]
        Severity: Minor
        Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 2 hrs 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_journals has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            def create_journals(self, cr, uid, journal_ids, wz, context=None):
                for journal in self.pool['account.journal'].browse(
                        cr, uid, journal_ids, context=context):
                    responsability = journal.company_id.responsability_id
                    if not responsability.id:
        Severity: Minor
        Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 2 hrs 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_available_journal_document_class has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            def _get_available_journal_document_class(self):
                invoice_type = self.type
                document_class_ids = []
                document_class_id = False
        
        
        Severity: Minor
        Found in l10n_cl_invoice/models/invoice.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 _use_level has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def _use_level(self):
                for r in self:
                    if r.status not in ['draft','cancelled']:
                        try:            
                            r.use_level = 100 * (
        Severity: Minor
        Found in l10n_cl_dte_caf/models/caf.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 action_number has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def action_number(self):
                obj_sequence = self.env['ir.sequence']
        
                # We write document_number field with next invoice number by
                # document type
        Severity: Minor
        Found in l10n_cl_invoice/models/invoice.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 _check_activities has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _check_activities(self):
                # self.ensure_one()
                # si entre los giros del diario hay alguno que está excento
                # el boolean es True
                try:
        Severity: Minor
        Found in l10n_cl_invoice/models/account.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 _printed_prices has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _printed_prices(self, cr, uid, ids, name, args, context=None):
                res = {}
                tax_obj = self.pool['account.tax']
                cur_obj = self.pool.get('res.currency')
        
        
        Severity: Minor
        Found in l10n_cl_invoice/models/invoice_line.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 create_template_envio has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def create_template_envio(self, RutEmisor, RutReceptor, FchResol, NroResol,
        Severity: Major
        Found in l10n_cl_dte/models/invoice.py - About 50 mins to fix

          Function create_journal_document has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def create_journal_document(self, cr, uid, letter_ids, document_type,
          Severity: Major
          Found in l10n_cl_invoice/wizard/journal_config_wizard.py - About 50 mins to fix

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

                def _printed_prices(self, cr, uid, ids, name, args, context=None):
            Severity: Minor
            Found in l10n_cl_invoice/models/invoice_line.py - About 45 mins to fix

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

                  def get_valid_document_letters(
              Severity: Minor
              Found in l10n_cl_invoice/models/invoice.py - About 45 mins to fix

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

                    def _get_parent_sii_code(self, cr, uid, ids, field_name, args, context=None):
                Severity: Minor
                Found in l10n_cl_invoice/models/account.py - About 45 mins to fix

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

                      def generic_connection(self):
                          _logger.warning('Entering function "test connection"')
                          base_url = self.url
                          
                          # token en el ecabezado (por ejemplo toggl)
                  Severity: Minor
                  Found in webservices_generic/models/webservices_generic.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 _get_document_data has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _get_document_data(self, cr, uid, ids, name, arg, context=None):
                  Severity: Minor
                  Found in l10n_cl_invoice/models/account.py - About 45 mins to fix

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

                        def _printed_prices(self, cr, uid, ids, name, args, context=None):
                    Severity: Minor
                    Found in l10n_cl_invoice/models/invoice.py - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language