KentaaNL/kentaa-api

View on GitHub

Showing 56 of 56 total issues

Class Donation has 57 methods (exceeds 20 allowed). Consider refactoring.
Open

      class Donation < Resource
        def object_key
          "Donation_#{id}"
        end

Severity: Major
Found in lib/kentaa/api/resources/donation.rb - About 1 day to fix

    Class Action has 50 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class Action < Resource
            WHO_TYPE_OWNER = 'owner'
            WHO_TYPE_OTHER = 'other'
    
            def object_key
    Severity: Minor
    Found in lib/kentaa/api/resources/action.rb - About 7 hrs to fix

      Class Company has 37 methods (exceeds 20 allowed). Consider refactoring.
      Open

            class Company < Resource
              def object_key
                "Company_#{id}"
              end
      
      
      Severity: Minor
      Found in lib/kentaa/api/resources/company.rb - About 4 hrs to fix

        Class Project has 34 methods (exceeds 20 allowed). Consider refactoring.
        Open

              class Project < Resource
                def object_key
                  "Project_#{id}"
                end
        
        
        Severity: Minor
        Found in lib/kentaa/api/resources/project.rb - About 4 hrs to fix

          Class Team has 30 methods (exceeds 20 allowed). Consider refactoring.
          Open

                class Team < Resource
                  def object_key
                    "Team_#{id}"
                  end
          
          
          Severity: Minor
          Found in lib/kentaa/api/resources/team.rb - About 3 hrs to fix

            Class User has 28 methods (exceeds 20 allowed). Consider refactoring.
            Open

                  class User < Resource
                    def object_key
                      "User_#{id}"
                    end
            
            
            Severity: Minor
            Found in lib/kentaa/api/resources/user.rb - About 3 hrs to fix

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

                    class Site < Resource
                      def object_key
                        "Site_#{id}"
                      end
              
              
              Severity: Minor
              Found in lib/kentaa/api/resources/site.rb - About 3 hrs to fix

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

                      class ManualDonation < Resource
                        def object_key
                          "Donation_#{id}"
                        end
                
                
                Severity: Minor
                Found in lib/kentaa/api/resources/manual_donation.rb - About 2 hrs to fix

                  Class Segment has 24 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                        class Segment < Resource
                          def object_key
                            "Segment_#{id}"
                          end
                  
                  
                  Severity: Minor
                  Found in lib/kentaa/api/resources/segment.rb - About 2 hrs to fix

                    Class List has 23 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                          class List < Base
                            include Enumerable
                    
                            def [](index)
                              resources[index]
                    Severity: Minor
                    Found in lib/kentaa/api/resources/list.rb - About 2 hrs to fix

                      Class RecurringDonor has 23 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                            class RecurringDonor < Resource
                              def object_key
                                "RecurringDonor_#{id}"
                              end
                      
                      
                      Severity: Minor
                      Found in lib/kentaa/api/resources/recurring_donor.rb - About 2 hrs to fix

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

                                def entity
                                  if action_id
                                    Kentaa::Api::Resources::Action.new(config, id: action_id, options: options)
                                  elsif team_id
                                    Kentaa::Api::Resources::Team.new(config, id: team_id, options: options)
                        Severity: Major
                        Found in lib/kentaa/api/resources/donation.rb and 1 other location - About 2 hrs to fix
                        lib/kentaa/api/resources/manual_donation.rb on lines 14..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 91.

                        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 entity
                                  if action_id
                                    Kentaa::Api::Resources::Action.new(config, id: action_id, options: options)
                                  elsif team_id
                                    Kentaa::Api::Resources::Team.new(config, id: team_id, options: options)
                        Severity: Major
                        Found in lib/kentaa/api/resources/manual_donation.rb and 1 other location - About 2 hrs to fix
                        lib/kentaa/api/resources/donation.rb on lines 14..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 91.

                        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

                        Method request has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def request(http_method, path, params = {}, body = nil, options = {})
                                uri = URI.parse(File.join(config.api_url, path))
                                uri.query = URI.encode_www_form(params) unless params.empty?
                        
                                content_type = options.fetch(:content_type, 'application/json')
                        Severity: Minor
                        Found in lib/kentaa/api/request.rb - About 1 hr to fix

                          Method request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def request(http_method, path, params = {}, body = nil, options = {})
                                  uri = URI.parse(File.join(config.api_url, path))
                                  uri.query = URI.encode_www_form(params) unless params.empty?
                          
                                  content_type = options.fetch(:content_type, 'application/json')
                          Severity: Minor
                          Found in lib/kentaa/api/request.rb - About 1 hr 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

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

                          module Kentaa
                            module Api
                              module Resources
                                class Video
                                  attr_reader :data
                          Severity: Minor
                          Found in lib/kentaa/api/resources/video.rb and 1 other location - About 50 mins to fix
                          lib/kentaa/api/resources/photo.rb on lines 5..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 42.

                          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

                          module Kentaa
                            module Api
                              module Resources
                                class Photo
                                  attr_reader :data
                          Severity: Minor
                          Found in lib/kentaa/api/resources/photo.rb and 1 other location - About 50 mins to fix
                          lib/kentaa/api/resources/video.rb on lines 5..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 42.

                          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 parent
                                    if project_id
                                      Kentaa::Api::Resources::Project.new(config, id: project_id, options: options)
                                    elsif segment_id
                                      Kentaa::Api::Resources::Segment.new(config, id: segment_id, options: options)
                          Severity: Minor
                          Found in lib/kentaa/api/resources/team.rb and 1 other location - About 45 mins to fix
                          lib/kentaa/api/resources/company.rb on lines 14..21

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

                          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 parent
                                    if project_id
                                      Kentaa::Api::Resources::Project.new(config, id: project_id, options: options)
                                    elsif segment_id
                                      Kentaa::Api::Resources::Segment.new(config, id: segment_id, options: options)
                          Severity: Minor
                          Found in lib/kentaa/api/resources/company.rb and 1 other location - About 45 mins to fix
                          lib/kentaa/api/resources/team.rb on lines 14..21

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

                          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

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

                                def request(http_method, path, params = {}, body = nil, options = {})
                          Severity: Minor
                          Found in lib/kentaa/api/request.rb - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language