gooddata/gooddata-ruby

View on GitHub

Showing 359 of 407 total issues

Method call has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def call(params)
          results = []

          client = params.gdc_gd_client
          development_client = params.development_client
Severity: Major
Found in lib/gooddata/lcm/actions/create_segment_masters.rb - About 3 hrs to fix

    File process.rb has 290 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'zip'
    require 'uri'
    
    require_relative '../helpers/global_helpers'
    require_relative '../rest/resource'
    Severity: Minor
    Found in lib/gooddata/models/process.rb - About 2 hrs to fix

      Method maqlify_filters has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.maqlify_filters(filters, user_profile_mapping, options = {})
            fail_early = options[:fail_early] == false ? false : true
            users_cache = options[:users_cache]
            labels_cache = create_label_cache(filters, options)
            small_labels = get_small_labels(labels_cache)
      Severity: Minor
      Found in lib/gooddata/models/user_filters/user_filter_builder.rb - About 2 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 create_user_profile_mapping has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.create_user_profile_mapping(filters, project_users, options = {})
            domain = options[:domain]
            found_list = {}
            missing_list = []
      
      
      Severity: Minor
      Found in lib/gooddata/models/user_filters/user_filter_builder.rb - About 2 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 migrate_date_dimension has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

              def migrate_date_dimension(params, segment_info)
                results = []
                client = params.gdc_gd_client
                latest_blueprint = segment_info[:from_blueprint]
                # don't migrate when latest master doesn't contain custom v2 date.
      Severity: Minor
      Found in lib/gooddata/lcm/actions/migrate_gdc_date_dimension.rb - About 2 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 profile.rb has 284 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'pmap'
      
      require_relative '../rest/object'
      
      require_relative 'project'
      Severity: Minor
      Found in lib/gooddata/models/profile.rb - About 2 hrs to fix

        Method find has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

              def find(stuff, opts = { :client => GoodData.connection, :project => GoodData.project })
                _client, project = GoodData.get_client_and_project(opts)
        
                stuff.map do |item|
                  obj = if item.is_a?(String)
        Severity: Minor
        Found in lib/gooddata/models/metadata/report_definition.rb - About 2 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 get_s3_config has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

              def get_s3_config(params)
                s3_config = {}
                if params.key?('aws_client')
                  GoodData.logger.warn('Found two configuration aws_client and s3_client for S3 input source, use aws_client configuration') if params.key?('s3_client')
                  raise 'Unable to connect to AWS. Parameter "aws_client" seems to be empty' unless params['aws_client']
        Severity: Minor
        Found in lib/gooddata/bricks/middleware/aws_middleware.rb - About 2 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 connect has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

                def connect(username, password = 'aaaa', opts = {})
                  execution_id = ""
                  if username.is_a?(Hash) && username.key?(:execution_id)
                    execution_id = username[:execution_id]
                    username.delete(:execution_id)
        Severity: Minor
        Found in lib/gooddata/rest/client.rb - About 2 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 call has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

                def call(params)
                  results = ThreadSafe::Array.new
                  collect_synced_status = collect_synced_status(params)
                  failed_projects = ThreadSafe::Array.new
        
        
        Severity: Minor
        Found in lib/gooddata/lcm/actions/synchronize_kd_dashboard_permission.rb - About 2 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 validate_input_source has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

                def validate_input_source(input_source, continue_on_error)
                  type = input_source[:type] if input_source&.dig(:type)
                  metric_format = input_source[:metric_format]
                  if type.blank?
                    raise "Incorrect configuration: 'type' of 'input_source' is required" unless continue_on_error
        Severity: Minor
        Found in lib/gooddata/lcm/actions/update_metric_formats.rb - About 2 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 transfer_everything has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

              def transfer_everything(client, domain, migration_spec, opts = {})
                filter_on_segment = migration_spec[:segments] || migration_spec['segments'] || []
        
                GoodData.logger.info('Ensuring Users - warning: works across whole domain not just provided segment(s)')
                ensure_users(domain, migration_spec, filter_on_segment)
        Severity: Minor
        Found in lib/gooddata/lcm/lcm.rb - About 2 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 process_response has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

              def process_response(options = {}, &block)
                retries = options[:tries] || Helpers::GD_MAX_RETRY
                process = options[:process]
                dont_reauth = options[:dont_reauth]
                options = options.reject { |k, _| [:process, :dont_reauth].include?(k) }
        Severity: Minor
        Found in lib/gooddata/rest/connection.rb - About 2 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 call has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def call(params)
                  logger = params.gdc_logger
        
                  client = params.gdc_gd_client
                  project = client.projects(params.gdc_project) || client.projects(params.gdc_project_id)
        Severity: Major
        Found in lib/gooddata/lcm/actions/execute_schedules.rb - About 2 hrs to fix

          Method add_user has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def add_user(user_data, name = nil, opts = { :client => GoodData.connection })
                  generated_pass = GoodData::Helpers::CryptoHelper.generate_password
                  domain_name = name || user_data[:domain]
                  user_data = user_data.to_hash
                  data = {
          Severity: Major
          Found in lib/gooddata/models/domain.rb - About 2 hrs to fix

            Method transfer_everything has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def transfer_everything(client, domain, migration_spec, opts = {})
                    filter_on_segment = migration_spec[:segments] || migration_spec['segments'] || []
            
                    GoodData.logger.info('Ensuring Users - warning: works across whole domain not just provided segment(s)')
                    ensure_users(domain, migration_spec, filter_on_segment)
            Severity: Major
            Found in lib/gooddata/lcm/lcm.rb - About 2 hrs to fix

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

                      def load_data(params, data_source)
                        first_name_column           = params.first_name_column&.downcase || 'first_name'
                        last_name_column            = params.last_name_column&.downcase || 'last_name'
                        login_column                = params.login_column&.downcase || 'login'
                        password_column             = params.password_column&.downcase || 'password'
              Severity: Major
              Found in lib/gooddata/lcm/actions/synchronize_users.rb - About 2 hrs to fix

                Method verify_existing_users has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    def self.verify_existing_users(filters, options = {})
                      users_must_exist = options[:users_must_exist] == false ? false : true
                      users_cache = options[:users_cache]
                      domain = options[:domain]
                
                
                Severity: Minor
                Found in lib/gooddata/models/user_filters/user_filter_builder.rb - About 2 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 decode_params has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def decode_params(params, options = {})
                        key = ENCODED_PARAMS_KEY.to_s
                        hidden_key = ENCODED_HIDDEN_PARAMS_KEY.to_s
                        data_params = params[key] || '{}'
                        hidden_data_params = if params.key?(hidden_key) && params[hidden_key].nil?
                Severity: Major
                Found in lib/gooddata/helpers/global_helpers_params.rb - About 2 hrs to fix

                  Method pick_correct_chunks has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def pick_correct_chunks(chunks, opts = {})
                            GoodData.logger.debug("update_preference") { opts[:update_preference].pretty_inspect }
                            preference = GoodData::Helpers.symbolize_keys(opts[:update_preference] || {})
                            preference = Hash[preference.map { |k, v| [k, GoodData::Helpers.to_boolean(v)] }]
                  
                  
                  Severity: Major
                  Found in lib/gooddata/models/project_creator.rb - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language