forward3d/rbhive

View on GitHub

Showing 65 of 414 total issues

Method grant_role has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option)
Severity: Minor
Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins to fix

    Method send_grant_role has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def send_grant_role(role_name, principal_name, principal_type, grantor, grantorType, grant_option)
    Severity: Minor
    Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins to fix

      Method recv_append_partition_by_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def recv_append_partition_by_name()
            result = receive_message(Append_partition_by_name_result)
            return result.success unless result.success.nil?
            raise result.o1 unless result.o1.nil?
            raise result.o2 unless result.o2.nil?
      Severity: Minor
      Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins 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 recv_get_fields has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def recv_get_fields()
            result = receive_message(Get_fields_result)
            return result.success unless result.success.nil?
            raise result.o1 unless result.o1.nil?
            raise result.o2 unless result.o2.nil?
      Severity: Minor
      Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins 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 recv_get_schema has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def recv_get_schema()
            result = receive_message(Get_schema_result)
            return result.success unless result.success.nil?
            raise result.o1 unless result.o1.nil?
            raise result.o2 unless result.o2.nil?
      Severity: Minor
      Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins 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_partitions_ps_with_auth has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names)
      Severity: Minor
      Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins to fix

        Method send_get_partitions_ps_with_auth has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def send_get_partitions_ps_with_auth(db_name, tbl_name, part_vals, max_parts, user_name, group_names)
        Severity: Minor
        Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins to fix

          Method recv_create_type has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def recv_create_type()
                result = receive_message(Create_type_result)
                return result.success unless result.success.nil?
                raise result.o1 unless result.o1.nil?
                raise result.o2 unless result.o2.nil?
          Severity: Minor
          Found in lib/thrift/thrift_hive_metastore.rb - About 45 mins 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def initialize(server, port = 10_000, options = {}, logger = StdOutLogger.new)
                options ||= {} # backwards compatibility
                raise "'options' parameter must be a hash" unless options.is_a?(Hash)
                
                if options[:transport] == :sasl and options[:sasl_params].nil?
          Severity: Minor
          Found in lib/rbhive/t_c_l_i_connection.rb - About 45 mins 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_partitions_with_auth has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names)
          Severity: Minor
          Found in lib/thrift/thrift_hive_metastore.rb - About 35 mins to fix

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

                def send_get_partitions_with_auth(db_name, tbl_name, max_parts, user_name, group_names)
            Severity: Minor
            Found in lib/thrift/thrift_hive_metastore.rb - About 35 mins to fix

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

                  def get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names)
              Severity: Minor
              Found in lib/thrift/thrift_hive_metastore.rb - About 35 mins to fix

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

                    def send_get_partition_with_auth(db_name, tbl_name, part_vals, user_name, group_names)
                Severity: Minor
                Found in lib/thrift/thrift_hive_metastore.rb - About 35 mins to fix

                  Method validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def validate
                          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status
                          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field serverProtocolVersion is unset!') unless @serverProtocolVersion
                          unless @serverProtocolVersion.nil? || ::Hive2::Thrift::TProtocolVersion::VALID_VALUES.include?(@serverProtocolVersion)
                            raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field serverProtocolVersion!')
                  Severity: Minor
                  Found in lib/thrift/t_c_l_i_service_types.rb - About 35 mins 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 async_fetch_in_batch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def async_fetch_in_batch(handles, batch_size = 1000, &block)
                        raise "No block given for the batch fetch request!" unless block_given?
                        # Can't get data from an unfinished query
                        unless async_is_complete?(handles)
                          raise "Can't perform fetch on a query in state: #{async_state(handles)}"
                  Severity: Minor
                  Found in lib/rbhive/t_c_l_i_connection.rb - About 35 mins 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 coerce_column has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def coerce_column(column_name, value)
                        type = column_type_map[column_name]
                        return INFINITY if (type != :string && value == "Infinity")
                        return NAN if (type != :string && value == "NaN")
                        return coerce_complex_value(value) if type.to_s =~ /^array/
                  Severity: Minor
                  Found in lib/rbhive/schema_definition.rb - About 35 mins 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 read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def read(sz)
                        len, = @transport.read(PAYLOAD_LENGTH_BYTES).unpack('l>') if @rbuf.nil?
                        sz = len if len && sz > len
                        @index += sz
                        ret = @rbuf.slice(@index - sz, sz) || Bytes.empty_byte_buffer
                  Severity: Minor
                  Found in lib/thrift/sasl_client_transport.rb - About 35 mins 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 coerce_column has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def coerce_column(column_name, value)
                        type = column_type_map[column_name]
                        return INFINITY if (type != :string && value == "Infinity")
                        return NAN if (type != :string && value == "NaN")
                        return coerce_complex_value(value) if type.to_s =~ /^array/
                  Severity: Minor
                  Found in lib/rbhive/t_c_l_i_schema_definition.rb - About 35 mins 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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def validate
                          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle
                          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field infoType is unset!') unless @infoType
                          unless @infoType.nil? || ::Hive2::Thrift::TGetInfoType::VALID_VALUES.include?(@infoType)
                            raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field infoType!')
                  Severity: Minor
                  Found in lib/thrift/t_c_l_i_service_types.rb - About 35 mins 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

                  Avoid too many return statements within this method.
                  Open

                          return :closed
                  Severity: Major
                  Found in lib/rbhive/t_c_l_i_connection.rb - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language