mumuki/mumuki-classroom-api

View on GitHub

Showing 9 of 10 total issues

Class App has 39 methods (exceeds 20 allowed). Consider refactoring.
Open

class Mumuki::Classroom::App < Sinatra::Application
  configure do
    enable :cross_origin
    set :allow_methods, [:get, :put, :post, :options, :delete]
    set :show_exceptions, false
Severity: Minor
Found in lib/mumuki/classroom/sinatra.rb - About 5 hrs to fix

    Class App has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Mumuki::Classroom::App < Sinatra::Application
    
      Mumukit::Platform.map_organization_routes!(self) do
    
        namespace '/api/courses/:course/massive' do
    Severity: Minor
    Found in lib/mumuki/classroom/sinatra/massive.rb - About 3 hrs to fix

      Class Assignment has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Mumuki::Classroom::Assignment < Mumuki::Classroom::Document
        include Mongoid::Timestamps
      
        field :guide, type: Hash
        field :student, type: Hash
      Severity: Minor
      Found in lib/mumuki/classroom/models/assignment.rb - About 2 hrs to fix

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

            def massive_response(processed, unprocessed, errored, errored_msg, hash = {})
        Severity: Minor
        Found in lib/mumuki/classroom/sinatra/massive.rb - About 35 mins to fix

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

            def self.pipeline(query, sorting, ordering, searching, projection)
          Severity: Minor
          Found in lib/mumuki/classroom/models/reporting.rb - About 35 mins to fix

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

              def self.aggregate(collection, query, paginated_params, query_params, projection)
            Severity: Minor
            Found in lib/mumuki/classroom/models/reporting.rb - About 35 mins to fix

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

                def self.build_pipeline(collection, query, paginated_params, query_params, projection)
              Severity: Minor
              Found in lib/mumuki/classroom/models/reporting.rb - About 35 mins to fix

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

                    class ByName < SortBy
                      def self.pipeline
                        [{'$addFields': {
                          'student.last_name': {'$toLower': '$student.last_name'},
                          'student.first_name': {'$toLower': '$student.first_name'}
                Severity: Minor
                Found in lib/mumuki/classroom/models/sorting/guide_progress.rb and 1 other location - About 15 mins to fix
                lib/mumuki/classroom/models/sorting/student.rb on lines 3..13

                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

                    class ByName < SortBy
                      def self.pipeline
                        [{'$addFields': {
                          'last_name': {'$toLower': '$last_name'},
                          'first_name': {'$toLower': '$first_name'}
                Severity: Minor
                Found in lib/mumuki/classroom/models/sorting/student.rb and 1 other location - About 15 mins to fix
                lib/mumuki/classroom/models/sorting/guide_progress.rb on lines 115..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 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