khusnetdinov/kazan

View on GitHub

Showing 8 of 8 total issues

Class AppBuilder has 55 methods (exceeds 20 allowed). Consider refactoring.
Open

  class AppBuilder < Rails::AppBuilder
    include Kazan::Actions

    def readme
      template 'README.md.erb', 'README.md'
Severity: Major
Found in lib/kazan/app_builder.rb - About 7 hrs to fix

    File app_builder.rb has 361 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Kazan
      # This class build new project
      class AppBuilder < Rails::AppBuilder
        include Kazan::Actions
    
    
    Severity: Minor
    Found in lib/kazan/app_builder.rb - About 4 hrs to fix

      Class AppGenerator has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class AppGenerator < Rails::Generators::AppGenerator
          hide!
      
          class_option :database, type: :string, aliases: '-d', default: 'postgresql',
                                  desc: "Configure for selected database (options: #{DATABASES.join('/')})"
      Severity: Minor
      Found in lib/kazan/generators/app_generator.rb - About 2 hrs to fix

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

            def spec_quality_tests
              create_file '.quality.yml'
        
              [
                'quality.yml',
        Severity: Minor
        Found in lib/kazan/app_builder.rb - About 1 hr to fix

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

            it 'does not have eslint warnings' do
              warnings = JSON.parse(result).first['warningCount']
              message = "Reek #{warnings} warnings, run '#{command}' to show them"
          
              expect(warnings).to eq(0), message
          Severity: Minor
          Found in templates/quality/specs/eslint_spec.rb and 1 other location - About 15 mins to fix
          templates/quality/specs/eslint_spec.rb on lines 18..22

          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

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

            it 'does not have brakeman warnings' do
              warnings = JSON.parse(result)['warnings'].size
              message = "Brakeman #{warnings} warnings, run '#{command}' to show them"
          
              expect(warnings).to eq(0), message
          Severity: Minor
          Found in templates/quality/specs/brakeman_spec.rb and 1 other location - About 15 mins to fix
          templates/quality/specs/brakeman_spec.rb on lines 32..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

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

            it 'does not have eslint errros' do
              errors = JSON.parse(result).first['errorCount']
              message = "Reek #{errors} errors, run '#{command}' to show them"
          
              expect(errors).to eq(0), message
          Severity: Minor
          Found in templates/quality/specs/eslint_spec.rb and 1 other location - About 15 mins to fix
          templates/quality/specs/eslint_spec.rb on lines 11..15

          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

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

            it 'does not have brakeman errors' do
              errors = JSON.parse(result)['errors'].size
              message = "Brakeman #{errors} errors, run '#{command}' to show them"
          
              expect(errors).to eq(0), message
          Severity: Minor
          Found in templates/quality/specs/brakeman_spec.rb and 1 other location - About 15 mins to fix
          templates/quality/specs/brakeman_spec.rb on lines 25..29

          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