LiteracyVolunteersOfMA/lvm-rails

View on GitHub

Showing 25 of 25 total issues

Method tutor_params has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def tutor_params
    params.require(:tutor).permit(
      :address1,
      :address2,
      :age_preference,
Severity: Major
Found in app/controllers/tutors_controller.rb - About 2 hrs to fix

    Method student_params has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def student_params
        params.require(:student).permit(
          :first_name,
          :last_name,
          :date_of_birth,
    Severity: Major
    Found in app/controllers/students_controller.rb - About 2 hrs to fix

      Class StudentsController has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class StudentsController < ApplicationController
        before_action :ensure_coordinator_or_admin!
        before_action :set_student, only: %i[show edit]
        helper_method :tutor?
      
      
      Severity: Minor
      Found in app/controllers/students_controller.rb - About 2 hrs to fix

        Method us_states has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def us_states
            [
              ['AK', 'AK'],
              ['AL', 'AL'],
              ['AR', 'AR'],
        Severity: Major
        Found in app/helpers/application_helper.rb - About 2 hrs to fix

          File tutors_controller.rb has 255 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class TutorsController < ApplicationController
            before_action :ensure_coordinator_or_admin!
            before_action :set_tutor, only: %i[show edit]
          
            add_breadcrumb 'Home', :root_path
          Severity: Minor
          Found in app/controllers/tutors_controller.rb - About 2 hrs to fix

            Method index has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def index
                add_breadcrumb 'Students'
            
                @assessments_button = {
                  text: 'View All Assessments',
            Severity: Minor
            Found in app/controllers/students_controller.rb - About 1 hr to fix

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

                def index
                  add_breadcrumb 'Tutors'
              
                  @new_button = {
                    text: 'Create New Tutor',
              Severity: Minor
              Found in app/controllers/tutors_controller.rb - About 1 hr to fix

                Method native_language has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def native_language
                    [
                      ['English', 'English'],
                      ['Albanian', 'Albanian'],
                      ['Arabic', 'Arabic'],
                Severity: Minor
                Found in app/helpers/tutors_helper.rb - About 1 hr to fix

                  Method student_assesments_index has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def student_assesments_index
                      @student = Student.of(current_user).find(params[:id])
                  
                      add_breadcrumb 'Students', students_path
                      add_breadcrumb 'Assessments', assessments_path
                  Severity: Minor
                  Found in app/controllers/assessments_controller.rb - About 1 hr to fix

                    Method referral has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def referral
                        [
                          ['ABE Center', 'ABE Center'],
                          ['Brochure/Poster/Flyer', 'Brochure/Poster/Flyer'],
                          ['Church', 'Church'],
                    Severity: Minor
                    Found in app/helpers/tutors_helper.rb - About 1 hr to fix

                      Method index has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def index
                          add_breadcrumb 'Students', students_path
                          add_breadcrumb 'Assessments'
                      
                          @clickable_rows = true
                      Severity: Minor
                      Found in app/controllers/assessments_controller.rb - About 1 hr to fix

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

                          def status_class_indicator
                            active  = ['Active']
                            info    = ['Waiting for re-match', 'Waiting for 1st match', 'On hold']
                            warning = ['Declined match', 'Unable to contact', 'Cannot match', 'Moved']
                            danger  = ['Exited', 'No show to appointment', 'Dropped out of training']
                        Severity: Minor
                        Found in app/models/tutor.rb and 1 other location - About 55 mins to fix
                        app/models/student.rb on lines 82..92

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

                        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

                          def status_class_indicator
                            active  = ['Active']
                            info    = ['Waiting for re-match', 'Waiting for 1st match', 'On hold']
                            warning = ['Declined match', 'Unable to contact', 'Cannot match', 'Moved']
                            danger  = ['Exited', 'No show to appointment', 'Dropped out of training']
                        Severity: Minor
                        Found in app/models/student.rb and 1 other location - About 55 mins to fix
                        app/models/tutor.rb on lines 104..114

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

                        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

                          def status_options
                            [
                              ['Active', 'Active'],
                              ['Waiting for re-match', 'Waiting for re-match'],
                              ['Waiting for 1st match', 'Waiting for 1st match'],
                        Severity: Minor
                        Found in app/helpers/tutors_helper.rb and 1 other location - About 35 mins to fix
                        app/helpers/students_helper.rb on lines 11..24

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

                        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

                          def services
                            [
                              ['Basic literacy tutoring', 'Basic literacy tutoring'],
                              ['ABE class', 'ABE class'],
                              ['ESOL tutoring', 'ESOL tutoring'],
                        Severity: Minor
                        Found in app/helpers/students_helper.rb and 1 other location - About 35 mins to fix
                        app/helpers/tutors_helper.rb on lines 133..146

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

                        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

                          def race
                            [
                              ['American Indian/Alaskan Native', 'American Indian/Alaskan Native'],
                              ['Asian', 'Asian'],
                              ['Black (not of Hispanic Origin) ', 'Black (not of Hispanic Origin) '],
                        Severity: Minor
                        Found in app/helpers/application_helper.rb and 1 other location - About 25 mins to fix
                        app/helpers/assessments_helper.rb on lines 27..38

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

                        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

                          def assessment_level
                            [
                              ['Does not apply', 'Does not apply'],
                              ['Easy', 'Easy'],
                              ['Medium', 'Medium'],
                        Severity: Minor
                        Found in app/helpers/assessments_helper.rb and 1 other location - About 25 mins to fix
                        app/helpers/application_helper.rb on lines 59..70

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

                        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

                          def index
                            add_breadcrumb 'User Accounts'
                        
                            @new_button = {
                              text: 'Create New user',
                        Severity: Minor
                        Found in app/controllers/users_controller.rb and 1 other location - About 25 mins to fix
                        app/controllers/coordinators_controller.rb on lines 7..28

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

                        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

                          def index
                            add_breadcrumb 'Coordinators'
                        
                            @new_button = {
                              text: 'Create New Coordinator',
                        Severity: Minor
                        Found in app/controllers/coordinators_controller.rb and 1 other location - About 25 mins to fix
                        app/controllers/users_controller.rb on lines 8..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 29.

                        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

                          def self.to_csv
                            attributes = Tutor.column_names
                            CSV.generate(headers: true) do |csv|
                              csv << attributes
                        
                        
                        Severity: Minor
                        Found in app/models/tutor.rb and 1 other location - About 20 mins to fix
                        app/models/student.rb on lines 113..119

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language