gooddata/gooddata-ruby

View on GitHub

Showing 359 of 407 total issues

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

        def call(params)
          client = params.gdc_gd_client

          results = []
          synchronize_clients = params[:segments].map do |segment_hash|
Severity: Major
Found in lib/gooddata/lcm/actions/collect_segment_clients.rb - About 2 hrs to fix

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

          def call(params)
            # Generate brick execution id
            execution_id = GoodData.gd_logger.execution_id
    
            # Convert possible jruby hash to plain hash
    Severity: Major
    Found in lib/gooddata/bricks/middleware/gooddata_middleware.rb - About 2 hrs to fix

      Method export_clone has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def export_clone(options = {})
            with_data = options[:data].nil? ? true : options[:data]
            with_users = options[:users].nil? ? false : options[:users]
      
            export = {
      Severity: Minor
      Found in lib/gooddata/models/project.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 [] has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

            def [](id, opts = {})
              domain = opts[:domain]
              segment = opts[:segment]
              fail ArgumentError, 'No :domain specified' if domain.nil?
              client = domain.client
      Severity: Minor
      Found in lib/gooddata/models/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 create_expression has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.create_expression(filter, labels_cache, lookups_cache, attr_cache, options = {}, login)
            values = filter[:values]
            # Do not create MUF for label when all its values is NULL (https://jira.intgdc.com/browse/TMA-1361)
            non_null_values = values.select { |value| !value.nil? && value.downcase != 'null' }
            return ['TRUE', []] if non_null_values.empty?
      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 call has a Cognitive Complexity of 17 (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_user_groups.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 17 (exceeds 5 allowed). Consider refactoring.
      Open

              def call(params)
                client = params.gdc_gd_client
      
                results = []
                synchronize_clients = params[:segments].map do |segment_hash|
      Severity: Minor
      Found in lib/gooddata/lcm/actions/collect_segment_clients.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

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

          class SchemaBlueprint
            attr_accessor :data, :project_blueprint
      
            def initialize(dim, blueprint)
              @data = dim
      Severity: Minor
      Found in lib/gooddata/models/blueprint/schema_blueprint.rb - About 2 hrs to fix

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

            class RedshiftConnectionInfo < ConnectionInfo
              def initialize(connection_info_json)
                @json = connection_info_json[GoodData::DataSource::REDSHIFT]
              end
        
        
        Severity: Minor
        Found in lib/gooddata/models/data_source.rb - About 2 hrs to fix

          Method transfer_processes has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def transfer_processes(from_project, to_project, options = {})
                  options = GoodData::Helpers.symbolize_keys(options)
                  aliases = {}
                  to_project_processes = to_project.processes
                  additional_hidden_params = options[:additional_hidden_params] || {}
          Severity: Major
          Found in lib/gooddata/models/project.rb - About 2 hrs to fix

            Method transfer_attribute_drillpaths has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def transfer_attribute_drillpaths(source_project, targets)
                    semaphore = Mutex.new
            
                    # Convert to array
                    targets = [targets] unless targets.is_a?(Array)
            Severity: Major
            Found in lib/gooddata/lcm/lcm.rb - About 2 hrs to fix

              Method create_users has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                    def create_users(list, default_domain = nil, opts = { :client => GoodData.connection, :project => GoodData.project })
                      default_domain_name = default_domain.respond_to?(:name) ? default_domain.name : default_domain
                      domain = client.domain(default_domain_name)
              
                      # Prepare cache for domain users
              Severity: Minor
              Found in lib/gooddata/models/domain.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 delete_segment_by_title has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              def delete_segment_by_title(title, segments, days = 14, force = false)
                return if segments.empty?
                dead_line = Time.now - days * 60 * 60 * 24
              
                filtered_segments = segments.select do |s|
              Severity: Minor
              Found in bin/test_projects_cleanup.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 log_user_filter_results has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  def log_user_filter_results(results, user_filters)
                    results ||= []
                    results.each do |result|
                      user_profile_url = result[:user]
                      status = result[:status]
              Severity: Minor
              Found in lib/gooddata/models/project_log_formatter.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_datasets has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                      def migrate_datasets(spec, opts = {})
                        opts = { client: GoodData.connection }.merge(opts)
                        dry_run = opts[:dry_run]
                        replacements = opts['maql_replacements'] || opts[:maql_replacements] || {}
                        update_preference = opts[:update_preference]
              Severity: Minor
              Found in lib/gooddata/models/project_creator.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 collect_clients has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                      def collect_clients(params, segment_names = nil)
                        client_id_column = params.client_id_column&.downcase || 'client_id'
                        segment_id_column = params.segment_id_column&.downcase || 'segment_id'
                        project_id_column = params.project_id_column&.downcase || 'project_id'
                        project_title_column = params.project_title_column&.downcase || 'project_title'
              Severity: Minor
              Found in lib/gooddata/lcm/actions/collect_clients.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 16 (exceeds 5 allowed). Consider refactoring.
              Open

                    def connect(username, password, options = {})
                      server = options[:server] || Helpers::AuthHelper.read_server
                      options = DEFAULT_LOGIN_PAYLOAD.merge(options)
                      headers = options[:headers] || {}
              
              
              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 retryable has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                      def retryable(options = {}, &_block)
                        opts = { :tries => 12, :on => RETRYABLE_ERRORS }.merge(options)
              
                        retry_exception = opts[:on]
                        retries = opts[:tries]
              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 collect_clients has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def collect_clients(params, segment_names = nil)
                        client_id_column = params.client_id_column&.downcase || 'client_id'
                        segment_id_column = params.segment_id_column&.downcase || 'segment_id'
                        project_id_column = params.project_id_column&.downcase || 'project_id'
                        project_title_column = params.project_title_column&.downcase || 'project_title'
              Severity: Major
              Found in lib/gooddata/lcm/actions/collect_clients.rb - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if metric.is_a?(String)
                          expression = metric || options[:expression]
                          extended_notation = options[:extended_notation] || false
                          title = options[:title]
                          summary = options[:summary]
                Severity: Critical
                Found in lib/gooddata/models/metadata/metric.rb - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language