tamaloa/direktkreditverwaltung

View on GitHub

Showing 37 of 37 total issues

Method create_with_balance! has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def self.create_with_balance!(number, balance, interest, start_time = Date.current, params = {})
Severity: Minor
Found in app/models/contract.rb - About 35 mins to fix

    Method name_for_movement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def name_for_movement(movement)
        return "Saldo" if movement[:type] == :initial_balance
        return "Zinsen" if movement[:type] == :interest_entry
        return "End-Saldo" if movement[:type] == :final_balance
        return "Einzahlung" if movement[:type] == :movement && movement[:amount] > 0.0
    Severity: Minor
    Found in app/helpers/application_helper.rb - 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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

          bounding_box [20 + 2*bounds.width/3.0, y_pos], width: bounds.width/3.0 do
            text "Registergericht: #{company.gmbh_register_number}", size: 8
            text "Steuernummer: #{company.gmbh_tax_number}", size: 8
          end
    Severity: Minor
    Found in app/pdfs/pdf_interest_letter.rb and 1 other location - About 35 mins to fix
    app/pdfs/pdf_year_closing_statement.rb on lines 140..143

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 35.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        bounding_box [20 + 2*bounds.width/3.0, y_pos], width: bounds.width/3.0 do
          text "Registergericht: #{company.gmbh_register_number}", size: 8
          text "Steuernummer: #{company.gmbh_tax_number}", size: 8
        end
    Severity: Minor
    Found in app/pdfs/pdf_year_closing_statement.rb and 1 other location - About 35 mins to fix
    app/pdfs/pdf_interest_letter.rb on lines 126..129

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 35.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Avoid too many return statements within this method.
    Open

        return "Auszahlung" if movement[:type] == :movement && movement[:amount] < 0.0
    Severity: Major
    Found in app/helpers/application_helper.rb - About 30 mins to fix

      Method contact_long has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def contact_long(contact)
          contact_line = contact_short(contact)
          return contact_line unless contact
          contact_line << " | #{contact.email}" unless contact.email.blank?
          contact_line << " | #{contact.address}" unless contact.address.blank?
      Severity: Minor
      Found in app/helpers/contacts_helper.rb - 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

      Method run_time has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def run_time(contract)
          months = contract.last_version.duration_months
          years = contract.last_version.duration_years
          end_date = contract.last_version.end_date
          return "#{months} months" unless months.blank?
      Severity: Minor
      Found in app/helpers/contracts_helper.rb - 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

      Method index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def index
      
          @start_date = 1.year.ago.beginning_of_year.to_date
          @end_date = Date.current
          if params[:year]
      Severity: Minor
      Found in app/controllers/accounting_entries_controller.rb - 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

      Method initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def initialize(contracts, year, view)
          super(page_size: 'A4', page_layout: :landscape, top_margin: 35)
          @contracts = contracts
          @year = year
          @view = view
      Severity: Minor
      Found in app/pdfs/pdf_interest_thanks.rb - 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

      Method interest_rates_and_dates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def interest_rates_and_dates
          versions = contract_versions_valid_in_set_time_range
      
          rates_and_dates = []
          versions.each_with_index do |version, index|
      Severity: Minor
      Found in app/models/interest_calculation.rb - 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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

            bounding_box [20 + bounds.width/3.0, y_pos], width: bounds.width/3.0 do
              text "Geschäftsführung", size: 8
              text company.gmbh_executive_board, size: 8
            end
      Severity: Minor
      Found in app/pdfs/pdf_interest_letter.rb and 1 other location - About 20 mins to fix
      app/pdfs/pdf_year_closing_statement.rb on lines 136..139

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 28.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          bounding_box [20 + bounds.width/3.0, y_pos], width: bounds.width/3.0 do
            text "Geschäftsführung", size: 8
            text company.gmbh_executive_board, size: 8
          end
      Severity: Minor
      Found in app/pdfs/pdf_year_closing_statement.rb and 1 other location - About 20 mins to fix
      app/pdfs/pdf_interest_letter.rb on lines 122..125

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 28.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

            if address
              address_array = address.split(',')
              (0..(address_array.length-2)).to_a.each do |i|
                text address_array[i]
              end
      Severity: Minor
      Found in app/pdfs/pdf_year_closing_statement.rb and 1 other location - About 15 mins to fix
      app/pdfs/pdf_interest_letter.rb on lines 50..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 26.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if address
                address_array = address.split(',')
                (0..(address_array.length-2)).to_a.each do |i|
                  text address_array[i]
                end
      Severity: Minor
      Found in app/pdfs/pdf_interest_letter.rb and 1 other location - About 15 mins to fix
      app/pdfs/pdf_year_closing_statement.rb on lines 91..97

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 26.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

            table data do
              row(0).font_style = :bold
              columns(2..6).align = :right
              self.row_colors = ["EEEEEE", "FFFFFF"]
              self.cell_style = {size: 8}
      Severity: Minor
      Found in app/pdfs/pdf_interest_overview.rb and 2 other locations - About 15 mins to fix
      app/pdfs/pdf_interest_letter.rb on lines 90..95
      app/pdfs/pdf_year_closing_statement.rb on lines 116..121

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 25.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

            table data do
              row(0).font_style = :bold
              columns(2..6).align = :right
              self.row_colors = ["EEEEEE", "FFFFFF"]
              self.cell_style = {size: 8}
      Severity: Minor
      Found in app/pdfs/pdf_interest_letter.rb and 2 other locations - About 15 mins to fix
      app/pdfs/pdf_interest_overview.rb on lines 31..36
      app/pdfs/pdf_year_closing_statement.rb on lines 116..121

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 25.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

          table data do
            row(0).font_style = :bold
            columns(2..6).align = :right
            self.row_colors = ["EEEEEE", "FFFFFF"]
            self.cell_style = {size: 8}
      Severity: Minor
      Found in app/pdfs/pdf_year_closing_statement.rb and 2 other locations - About 15 mins to fix
      app/pdfs/pdf_interest_letter.rb on lines 90..95
      app/pdfs/pdf_interest_overview.rb on lines 31..36

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 25.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language