tamaloa/direktkreditverwaltung

View on GitHub
app/pdfs/pdf_year_closing_statement.rb

Summary

Maintainability
B
5 hrs
Test Coverage

Method postal_address_and_header has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def postal_address_and_header
    image_width = 180
    image_heigth = 52
    address_y_pos = 110

Severity: Minor
Found in app/pdfs/pdf_year_closing_statement.rb - About 1 hr to fix

    Method initialize has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def initialize(statement)
        @statement = statement
        @contract = statement.contract
        @year = statement.year
        super(page_size: 'A4', top_margin: 30, left_margin: 55)
    Severity: Minor
    Found in app/pdfs/pdf_year_closing_statement.rb - About 1 hr to fix

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

            text company.name, size: 10
            text "Projekt im Mietshäuser Syndikat", size: 8, style: :italic
            move_down 10
            text company.street, size: 8
            text "#{company.zip_code} #{company.city}", size: 8
      Severity: Major
      Found in app/pdfs/pdf_year_closing_statement.rb and 1 other location - About 1 hr to fix
      app/pdfs/pdf_interest_letter.rb on lines 32..40

      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 48.

      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

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

      There are no issues that match your filters.

      Category
      Status