osbzr/gooderp_addons

View on GitHub
money/report/supplier_statements.py

Summary

Maintainability
A
3 hrs
Test Coverage

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

    def create_source_docx_partner(self, cr, uid, ids, report, records, init_pay, context=None):
Severity: Major
Found in money/report/supplier_statements.py - About 50 mins to fix

    Function create has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def create(self, cr, uid, ids, data, context=None):
    Severity: Minor
    Found in money/report/supplier_statements.py - About 35 mins to fix

      Function customer_statement_report has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def customer_statement_report(self, cr, uid, ids, report_id, context=None):
      Severity: Minor
      Found in money/report/supplier_statements.py - About 35 mins to fix

        Function supplier_statement_report has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def supplier_statement_report(self, cr, uid, ids, report_id, context=None):
        Severity: Minor
        Found in money/report/supplier_statements.py - About 35 mins to fix

          Function create_source_docx_partner has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def create_source_docx_partner(self, cr, uid, ids, report, records, init_pay, context=None):
                  # 2016-11-2 支持了图片
                  # 1.导入依赖,python3语法
                  # from . import report_helper
                  # 2. 需要添加一个"tpl"属性获得模版对象
          Severity: Minor
          Found in money/report/supplier_statements.py - About 35 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

          Line too long (97 > 79 characters)
          Open

                          return self.create_source_docx_partner(cr, uid, ids, report_id, None, 0, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (105 > 79 characters)
          Open

                                                                          ('date', '>=', context.get('from_date')),
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (104 > 79 characters)
          Open

                                                                          ('date', '<=', context.get('to_date'))])
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (81 > 79 characters)
          Open

                      doc.render({'obj': simple_dict, 'tpl': doc}, report_helper.get_env())
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (95 > 79 characters)
          Open

                      return self.customer_statement_report(cr, uid, ids, report_ids[0], context=context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (84 > 79 characters)
          Open

                      SELECT  ROW_NUMBER() OVER(ORDER BY partner_id, date, amount desc) AS id,
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (95 > 79 characters)
          Open

                      return self.supplier_statement_report(cr, uid, ids, report_ids[0], context=context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (105 > 79 characters)
          Open

                                                                          ('date', '>=', context.get('from_date')),
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (111 > 79 characters)
          Open

                  records = env.get('customer.statements.report').search([('partner_id', '=', context.get('partner_id')),
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (104 > 79 characters)
          Open

                          return self.create_source_docx_partner(cr, uid, ids, report_id, None, init_pay, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (95 > 79 characters)
          Open

                      if r['model'] == 'partner.statements.report.wizard' and r['report_type'] == 'docx':
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (104 > 79 characters)
          Open

                          return self.create_source_docx_partner(cr, uid, ids, report_id, None, init_pay, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (96 > 79 characters)
          Open

                      return self.create_source_docx_partner(cr, uid, ids, report_id, records, 0, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (97 > 79 characters)
          Open

                          return self.create_source_docx_partner(cr, uid, ids, report_id, None, 0, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (83 > 79 characters)
          Open

                      self.balance_amount += pre.amount - pre.pay_amount + pre.discount_money
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (81 > 79 characters)
          Open

                  return super(ReportDocxPartner, self).create(cr, uid, ids, data, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (111 > 79 characters)
          Open

                  records = env.get('supplier.statements.report').search([('partner_id', '=', context.get('partner_id')),
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (96 > 79 characters)
          Open

                      return self.create_source_docx_partner(cr, uid, ids, report_id, records, 0, context)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (104 > 79 characters)
          Open

                                                                          ('date', '<=', context.get('to_date'))])
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (96 > 79 characters)
          Open

              def create_source_docx_partner(self, cr, uid, ids, report, records, init_pay, context=None):
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (106 > 79 characters)
          Open

                      simple_dict['init_pay'] = data[0].balance_amount - data[0].amount + data[0].pay_amount - data[
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (98 > 79 characters)
          Open

                          return ReportDocxPartner('report.' + r['report_name'], r['model'], register=False)
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (85 > 79 characters)
          Open

                  partner = env.get('partner').search([('id', '=', context.get('partner_id'))])
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (81 > 79 characters)
          Open

          from odoo.addons.report_docx.report.report_docx import ReportDocx, DataModelProxy
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Line too long (99 > 79 characters)
          Open

                  report_ids = env.get('ir.actions.report.xml').search([('report_name', '=', self.name[7:])])
          Severity: Minor
          Found in money/report/supplier_statements.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          There are no issues that match your filters.

          Category
          Status