osbzr/gooderp_addons

View on GitHub

Showing 391 of 2,652 total issues

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 buy/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

Avoid too many return statements within this function.
Open

        return docx.shared.Twips(float(s[:-5]))
Severity: Major
Found in report_docx/report/report_helper.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return docx.shared.Emu(float(s[:-3]))
    Severity: Major
    Found in report_docx/report/report_helper.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return;
      Severity: Major
      Found in backend_theme/static/lib/js/iscroll-probe.5.2.0.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return docx.shared.Pt(float(s))
        Severity: Major
        Found in report_docx/report/report_helper.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return self.env.user.company_id.import_tax_rate
          Severity: Major
          Found in goods/models/goods.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return docx.shared.Pt(float(s[:-2]))
            Severity: Major
            Found in report_docx/report/report_helper.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return partner_tax_rate
              Severity: Major
              Found in goods/models/goods.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return self.env.user.company_id.output_tax_rate
                Severity: Major
                Found in goods/models/goods.py - About 30 mins to fix

                  Function view_detail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def view_detail(self):
                          '''销售汇总表(按商品)查看明细按钮'''
                          self.ensure_one()
                          line_ids = []
                          res = []
                  Severity: Minor
                  Found in sell/report/sell_summary_goods.py - About 25 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 view_detail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def view_detail(self):
                          '''销售汇总表(按客户)查看明细按钮'''
                          self.ensure_one()
                          line_ids = []
                          res = []
                  Severity: Minor
                  Found in sell/report/sell_summary_partner.py - About 25 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_temp_false has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _compute_temp_false(self, field, temp):
                          if not temp:
                              if field and field.type in ('integer', 'float'):
                                  return 0
                          if field.type == 'float' and int(temp) == temp:
                  Severity: Minor
                  Found in report_docx/report/report_docx.py - About 25 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 name_get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def name_get(self):
                          '''在many2one字段里显示 编号_名称'''
                          res = []
                  
                          for adds in self:
                  Severity: Minor
                  Found in partner_address/models/partner_address.py - About 25 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_uom has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def create_uom(self):
                          for mx in self.line_ids:
                              uom = mx.product_unit
                              if uom:
                                  uom_id = self.env['uom'].search([('name', '=', uom)])
                  Severity: Minor
                  Found in cn_account_invoice/models/cn_account_invoice.py - About 25 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 _put_info_to_partner has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _put_info_to_partner(self, child):
                          self.contact = child.contact
                          self.mobile = child.mobile
                          self.phone = child.phone
                          self.qq = child.qq
                  Severity: Minor
                  Found in partner_address/models/partner_address.py - About 25 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 to_money_invoice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def to_money_invoice(self):
                          tax = 0
                          bill_number = ''
                          for line in self.line_ids:
                              if line.invoice_type == 'zy':
                  Severity: Minor
                  Found in staff_expense/models/hr_expense.py - About 25 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 view_detail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def view_detail(self):
                          '''销售汇总表(按销售人员)查看明细按钮'''
                          self.ensure_one()
                          line_ids = []
                          res = []
                  Severity: Minor
                  Found in sell/report/sell_summary_staff.py - About 25 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_sell_delivery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_sell_delivery(self, goods_id, attribute_id):
                          ''' 查找缺货发货单 '''
                          sell_delivery_lists = []
                          for active_model in self.env[self.active_model].browse(self.env.context.get('active_ids')):
                              for line in active_model.line_out_ids:
                  Severity: Minor
                  Found in warehouse_wave/models/wave.py - About 25 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 other_money_done has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def other_money_done(self):
                          '''其他收支单的审核按钮'''
                          self.ensure_one()
                          if float_compare(self.total_amount, 0, 3) <= 0:
                              raise UserError(u'金额应该大于0。\n金额:%s' % self.total_amount)
                  Severity: Minor
                  Found in money/models/other_money_order.py - About 25 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 _sell_amount_to_invoice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _sell_amount_to_invoice(self):
                          '''销售费用产生结算单'''
                          invoice_id = False
                          if sum(cost_line.amount for cost_line in self.cost_line_ids) > 0:
                              for line in self.cost_line_ids:
                  Severity: Minor
                  Found in sell/models/sell_delivery.py - About 25 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