forward3d/rbhive

View on GitHub

Showing 65 of 414 total issues

File thrift_hive_metastore.rb has 3042 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'thrift'
require_relative 'facebook_service'
require_relative 'hive_metastore_types'

module ThriftHiveMetastore
Severity: Major
Found in lib/thrift/thrift_hive_metastore.rb - About 1 wk to fix

    File t_c_l_i_service_types.rb has 1349 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'thrift'
    
    module Hive2
      module Thrift
        module TProtocolVersion
    Severity: Major
    Found in lib/thrift/t_c_l_i_service_types.rb - About 3 days to fix

      Class Client has 171 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Client < ::FacebookService::Client 
          include ::Thrift::Client
      
          def create_database(database)
            send_create_database(database)
      Severity: Major
      Found in lib/thrift/thrift_hive_metastore.rb - About 3 days to fix

        File t_c_l_i_service.rb has 774 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'thrift'
        require_relative 't_c_l_i_service_types'
        
        module Hive2
          module Thrift
        Severity: Major
        Found in lib/thrift/t_c_l_i_service.rb - About 1 day to fix

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

            class Processor < ::FacebookService::Processor 
              include ::Thrift::Processor
          
              def process_create_database(seqid, iprot, oprot)
                args = read_args(iprot, Create_database_args)
          Severity: Major
          Found in lib/thrift/thrift_hive_metastore.rb - About 1 day to fix

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

                  class Client
                    include ::Thrift::Client
            
                    def OpenSession(req)
                      send_OpenSession(req)
            Severity: Major
            Found in lib/thrift/t_c_l_i_service.rb - About 1 day to fix

              File facebook_service.rb has 496 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'thrift'
              require_relative 'fb303_types'
              
              module FacebookService
                class Client
              Severity: Minor
              Found in lib/thrift/facebook_service.rb - About 7 hrs to fix

                File hive_metastore_types.rb has 481 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'thrift'
                require_relative 'fb303_types'
                
                
                module HiveObjectType
                Severity: Minor
                Found in lib/thrift/hive_metastore_types.rb - About 7 hrs to fix

                  Class TCLIConnection has 43 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                    class TCLIConnection
                      attr_reader :client
                  
                      def initialize(server, port = 10_000, options = {}, logger = StdOutLogger.new)
                        options ||= {} # backwards compatibility
                  Severity: Minor
                  Found in lib/rbhive/t_c_l_i_connection.rb - About 5 hrs to fix

                    File thrift_hive.rb has 376 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'thrift'
                    require_relative 'thrift_hive_metastore'
                    require_relative 'hive_service_types'
                    
                    module Hive
                    Severity: Minor
                    Found in lib/thrift/thrift_hive.rb - About 5 hrs to fix

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

                        class Client
                          include ::Thrift::Client
                      
                          def getName()
                            send_getName()
                      Severity: Minor
                      Found in lib/thrift/facebook_service.rb - About 4 hrs to fix

                        File t_c_l_i_connection.rb has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        old_verbose, $VERBOSE = $VERBOSE, nil
                        
                        raise 'Thrift is not loaded' unless defined?(Thrift)
                        raise 'RBHive is not loaded' unless defined?(RBHive)
                        
                        
                        Severity: Minor
                        Found in lib/rbhive/t_c_l_i_connection.rb - About 4 hrs to fix

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

                                class Client < ::ThriftHiveMetastore::Client 
                                  include ::Thrift::Client
                          
                                  def execute(query)
                                    send_execute(query)
                          Severity: Minor
                          Found in lib/thrift/thrift_hive.rb - About 2 hrs to fix

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

                              class Connection
                                attr_reader :client
                                
                                def initialize(server, port=10_000, logger=StdOutLogger.new)
                                  @socket = Thrift::Socket.new(server, port)
                            Severity: Minor
                            Found in lib/rbhive/connection.rb - About 2 hrs to fix

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

                                    def validate
                                      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle
                                      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field orientation is unset!') unless @orientation
                                      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field maxRows is unset!') unless @maxRows
                                      unless @orientation.nil? || ::Hive2::Thrift::TFetchOrientation::VALID_VALUES.include?(@orientation)
                              Severity: Minor
                              Found in lib/thrift/t_c_l_i_service_types.rb - About 55 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 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def validate
                                      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationId is unset!') unless @operationId
                                      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationType is unset!') unless @operationType
                                      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field hasResultSet is unset!') if @hasResultSet.nil?
                                      unless @operationType.nil? || ::Hive2::Thrift::TOperationType::VALID_VALUES.include?(@operationType)
                              Severity: Minor
                              Found in lib/thrift/t_c_l_i_service_types.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_append_partition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def recv_append_partition()
                                    result = receive_message(Append_partition_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_add_partition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def recv_add_partition()
                                    result = receive_message(Add_partition_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_add_index has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def recv_add_index()
                                    result = receive_message(Add_index_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_create_table has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def recv_create_table()
                                    result = receive_message(Create_table_result)
                                    raise result.o1 unless result.o1.nil?
                                    raise result.o2 unless result.o2.nil?
                                    raise result.o3 unless result.o3.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

                              Severity
                              Category
                              Status
                              Source
                              Language