osbzr/gooderp_addons

View on GitHub

Showing 391 of 2,652 total issues

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

    def _get_or_pay(self, line, business_type,
Severity: Minor
Found in money/models/money_order.py - About 35 mins to fix

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

        def search_read(self, domain=None, fields=None, offset=0, limit=80, order=None):
    Severity: Minor
    Found in warehouse/report/report_base.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 _get_invoice_vals has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _get_invoice_vals(self, partner_id, category_id, date, amount, tax_amount):
        Severity: Minor
        Found in buy/models/buy_receipt.py - About 35 mins to fix

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

              def _compute_by_selection(self, field, temp):
                  if field and field.type == 'selection':
                      selection = field.selection
                      if isinstance(selection, basestring):
                          selection = getattr(self.data, selection)()
          Severity: Minor
          Found in report_docx/report/report_docx.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

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

              def hr_expense_draft(self):
                  '''删掉其他应付款单'''
                  if self.state == 'draft':
                      raise UserError(u'请不要重复撤销')
                  if self.other_money_order:
          Severity: Minor
          Found in staff_expense/models/hr_expense.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

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

              def onchange_goods_id(self):
                  '''当订单行的商品变化时,带出商品上的零售价,以及公司的销项税'''
                  self.ensure_one()
                  is_return = self.env.context.get('default_is_return')
                  if self.goods_id:
          Severity: Minor
          Found in sell/models/sell_delivery.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

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

              def auto_reconcile_sell_order(self):
                  ''' 预收款与结算单自动核销 '''
                  all_delivery_amount = 0
                  for delivery in self.order_id.delivery_ids:
                      all_delivery_amount += delivery.amount
          Severity: Minor
          Found in sell/models/sell_delivery.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

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

              def find_source_order(self):
                  # 查看原始单据,三种情况:收款单、销售退货单、销售发货单、核销单
                  self.ensure_one()
                  model_view = {
                      'money.order': {'name': u'收款单',
          Severity: Minor
          Found in sell/report/customer_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

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

              def find_source_order(self):
                  # 查看原始单据,三种情况:收款单、销售退货单、销售发货单
                  self.ensure_one()
                  model_view = {
                      'money.order': {'name': u'收款单',
          Severity: Minor
          Found in sell/report/customer_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

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

              def money_invoice_done(self):
                  """
                  结算单审核方法
                  :return: 
                  """
          Severity: Minor
          Found in money/models/money_order.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

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

              def apportion_cost(self, cost):
                  for assembly in self:
                      if not assembly.line_in_ids:
                          continue
          
          
          Severity: Minor
          Found in warehouse/models/production.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

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

              def _compute_current_rate(self):
                  date = self._context.get('date') or fields.Datetime.now()
                  period_id = self.env['finance.period'].get_period(date).id
                  for currency in self:
                      currency.rate = 1.0
          Severity: Minor
          Found in auto_exchange/models/auto_exchange.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

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

              def create_vourcher_line_data(self, outsource, voucher_row):
                  """
                  准备入库凭证行数据
                  借:库存商品(商品上)
                  贷:生产成本-基本生产成本(核算分类上)
          Severity: Minor
          Found in warehouse/models/production.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

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

              def create_vourcher_line_data(self, disassembly, voucher_row):
                  """
                  准备入库凭证行数据
                  借:库存商品(商品上)
                  贷:生产成本-基本生产成本(核算分类上)
          Severity: Minor
          Found in warehouse/models/production.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

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

              def apportion_cost(self, cost):
                  for assembly in self:
                      if not assembly.line_in_ids:
                          continue
          
          
          Severity: Minor
          Found in warehouse/models/production.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

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

              def _process_domain(self, result, domain):
                  if domain and len(domain) == 3:
                      field, opto, value = domain
          
                      compute_operator = {
          Severity: Minor
          Found in warehouse/report/report_base.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

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

              def _get_or_pay(self, line, business_type,
                              partner_id, to_partner_id, name):
                  """
                  核销单 核销时 对具体核销单行进行的操作
                  :param line:
          Severity: Minor
          Found in money/models/money_order.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

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

              def check_is_child_enable(self):
                  for child_line in self.line_out_ids:
                      for parent_line in self.line_in_ids:
                          if child_line.goods_id.id == parent_line.goods_id.id and child_line.attribute_id.id == parent_line.attribute_id.id:
                              raise UserError(u'子件中不能包含与组合件中相同的 产品+属性,%s' % parent_line.goods_id.name)
          Severity: Minor
          Found in warehouse/models/production.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

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

              def check_is_child_enable(self):
                  for child_line in self.line_in_ids:
                      for parent_line in self.line_out_ids:
                          if child_line.goods_id.id == parent_line.goods_id.id and child_line.attribute_id.id == parent_line.attribute_id.id:
                              raise UserError(u'子件中不能包含与组合件中相同的 产品+属性,%s' % parent_line.goods_id.name)
          Severity: Minor
          Found in warehouse/models/production.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

          Severity
          Category
          Status
          Source
          Language