gooddata/gooddata-ruby

View on GitHub

Showing 359 of 407 total issues

File project.rb has 1684 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'csv'
require 'zip'
require 'fileutils'
require 'multi_json'
require 'pmap'
Severity: Major
Found in lib/gooddata/models/project.rb - About 4 days to fix

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

      class Project < Rest::Resource
        USER_ACCOUNT_PATH = '/gdc/account/profile/'
        USERSPROJECTS_PATH = USER_ACCOUNT_PATH + '%s/projects'
        PROJECTS_PATH = '/gdc/projects'
        PROJECT_PATH = '/gdc/projects/%s'
    Severity: Major
    Found in lib/gooddata/models/project.rb - About 3 days to fix

      Method call has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(params)
                client = params.gdc_gd_client
                data_product = params.data_product
                collect_synced_status = collect_synced_status(params)
                failed_projects = ThreadSafe::Array.new
      Severity: Minor
      Found in lib/gooddata/lcm/actions/synchronize_etls_in_segment.rb - About 1 day 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

      Method call has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(params)
                client = params.gdc_gd_client
                domain_name = params.organization || params.domain
                fail "Either organisation or domain has to be specified in params" unless domain_name
                project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
      Severity: Minor
      Found in lib/gooddata/lcm/actions/synchronize_users.rb - About 1 day 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

      Method transfer_schedules has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
      Open

            def transfer_schedules(from_project, to_project, has_cycle_trigger = false)
              to_project_processes = to_project.processes.sort_by(&:name)
              from_project_processes = from_project.processes.sort_by(&:name)
              from_project_processes.reject!(&:add_v2_component?)
      
      
      Severity: Minor
      Found in lib/gooddata/models/project.rb - About 1 day 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

      Method call has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(params)
                client = params.gdc_gd_client
                domain_name = params.organization || params.domain
                fail "Either organisation or domain has to be specified in params" unless domain_name
      
      
      Severity: Minor
      Found in lib/gooddata/lcm/actions/synchronize_user_filters.rb - About 1 day 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

      Method call has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(params)
                synchronize_projects = []
                data_product = params.data_product
                client = params.gdc_gd_client
                collect_synced_status = collect_synced_status(params)
      Severity: Minor
      Found in lib/gooddata/lcm/actions/provision_clients.rb - About 1 day 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

      File connection.rb has 551 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'terminal-table'
      require 'securerandom'
      require 'monitor'
      require 'thread_safe'
      require 'rest-client'
      Severity: Major
      Found in lib/gooddata/rest/connection.rb - About 1 day to fix

        Class ProjectBlueprint has 60 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class ProjectBlueprint
              attr_accessor :data
        
              # Instantiates a project blueprint either from a file or from a string containing
              # json. Also eats Hash for convenience.
        Severity: Major
        Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 1 day to fix

          File data_source.rb has 502 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require_relative '../rest/resource'
          
          module GoodData
            class DataSource < Rest::Resource
              attr_accessor :connection_info
          Severity: Major
          Found in lib/gooddata/models/data_source.rb - About 1 day to fix

            File user_filter_builder.rb has 499 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require_relative '../project_log_formatter'
            
            require 'active_support/core_ext/hash/indifferent_access'
            
            require 'gooddata/extensions/true'
            Severity: Minor
            Found in lib/gooddata/models/user_filters/user_filter_builder.rb - About 1 day to fix

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

                class Schedule < Rest::Resource
                  attr_reader :dirty, :json
              
                  SCHEDULE_TEMPLATE = {
                    :schedule => {
              Severity: Major
              Found in lib/gooddata/models/schedule.rb - About 7 hrs to fix

                Method execute_mufs has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.execute_mufs(user_filters, options = {})
                      client = options[:client]
                      project = options[:project]
                      ignore_missing_values = options[:ignore_missing_values]
                      users_must_exist = options[:users_must_exist] == false ? false : true
                Severity: Minor
                Found in lib/gooddata/models/user_filters/user_filter_builder.rb - About 7 hrs 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

                Class Profile has 51 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  class Profile < Rest::Resource
                    attr_reader :user, :json
                
                    EMPTY_OBJECT = {
                      'accountSetting' => {
                Severity: Major
                Found in lib/gooddata/models/profile.rb - About 7 hrs to fix

                  Method upload_multiple_data has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def upload_multiple_data(data, project_blueprint, options = { :client => GoodData.connection, :project => GoodData.project })
                          client, project = GoodData.get_client_and_project(options)
                          project ||= GoodData.project
                  
                          manifest = {
                  Severity: Minor
                  Found in lib/gooddata/models/model.rb - About 7 hrs 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

                  File project_blueprint.rb has 459 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module GoodData
                    module Model
                      class ProjectBlueprint
                        attr_accessor :data
                  
                  
                  Severity: Minor
                  Found in lib/gooddata/models/blueprint/project_blueprint.rb - About 7 hrs to fix

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

                        class DatasetBlueprint < SchemaBlueprint
                          # Checks if a dataset has an anchor.
                          #
                          # @param dataset [Hash] Dataset blueprint
                          # @return [Boolean] returns true if dataset has an anchor
                    Severity: Minor
                    Found in lib/gooddata/models/blueprint/dataset_blueprint.rb - About 7 hrs to fix

                      Method import_users has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def import_users(new_users, options = {})
                            role_list = roles
                            users_list = users
                      
                            GoodData.logger.warn("Importing users to project (#{pid})")
                      Severity: Minor
                      Found in lib/gooddata/models/project.rb - About 6 hrs 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

                      Method sync_segment_ldm has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def sync_segment_ldm(params, segment_info)
                                collect_synced_status = collect_synced_status(params)
                                failed_projects = ThreadSafe::Array.new
                                results = ThreadSafe::Array.new
                                client = params.gdc_gd_client
                      Severity: Minor
                      Found in lib/gooddata/lcm/actions/synchronize_ldm.rb - About 6 hrs 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

                      Class Membership has 47 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Membership < Rest::Resource
                          attr_reader :json
                      
                          ASSIGNABLE_MEMBERS = [
                            :email,
                      Severity: Minor
                      Found in lib/gooddata/models/membership.rb - About 6 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language