hackedteam/rcs-db

View on GitHub

Showing 453 of 612 total issues

Method deliver has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def deliver(params)
    trace :debug, "Build: deliver: #{params} #{@outputs}"

    # zip all the outputs and send them to the collector
    # it will create a subdir automatically
Severity: Major
Found in lib/rcs-db/build/wap.rb - About 2 hrs to fix

    Method check has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def check(field)
        # these check are performed just before the creation of an object.
        # thus the comparison is strictly < and not <=
        case (field)
          when :users
    Severity: Minor
    Found in lib/rcs-db/license.rb - About 2 hrs to fix

      Method load_license has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def load_license(periodic = false)
      
          # load the license file
          lic_file = File.join $execution_directory, RCS::DB::Config::CONF_DIR, LICENSE_FILE
      
      
      Severity: Minor
      Found in lib/rcs-db/license.rb - About 2 hrs to fix

        Method run! has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.run!(*argv)
        
            # This hash will hold all of the options parsed from the command-line by OptionParser.
            options = {}
        
        
        Severity: Minor
        Found in scripts/rcs-kill.rb - About 1 hr to fix

          Method sign has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def sign(params)
              trace :debug, "Build: signing: #{params}"
          
              trace :debug, "Build: creating sisx files"
          
          
          Severity: Minor
          Found in lib/rcs-db/build/symbian.rb - About 1 hr to fix

            Method inject_html_flash has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              def inject_html_flash(intercept_files, progressive, redirect_user, rule, vector_files)
                appname = 'FlashSetup-' + progressive.to_s
                intercept_files << "#{redirect_user["#{rule.ident} #{rule.ident_param}"]} #{rule.action} #{appname} #{rule.resource}"
            
                begin
            Severity: Minor
            Found in lib/rcs-db/tasks/injector.rb - About 1 hr 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 login has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              def login
                case @request[:method]
                  # return the info about the current auth session
                  when 'GET'
                    sess = SessionManager.instance.get(@request[:cookie])
            Severity: Minor
            Found in lib/rcs-db/rest/auth.rb - About 1 hr 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 filesystem has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              def filesystem
                require_auth_level :server, :view
            
                mongoid_query do
                  agent = Item.where({_kind: 'agent', _id: @params['_id']}).first
            Severity: Minor
            Found in lib/rcs-db/rest/agent.rb - About 1 hr 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 resample_channel has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                def resample_channel(wav_ary, sample_rate, is_short = false)
                  errorptr = FFI::MemoryPointer.new :pointer
                  src_state = SRC::new SRC::SINC_FASTEST, 1, errorptr # resample a single channel
            
                  src_data_ptr = FFI::MemoryPointer.new SRC::DATA.size, 1, false
            Severity: Minor
            Found in lib/rcs-worker/libs/SRC/src.rb - About 1 hr 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 most_contacted has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.most_contacted(target_id, params)
                start = Time.now
                most_contacted_types = [:chat, :mail, :sms, :mms, :facebook,
                                        :gmail, :skype, :bbm, :whatsapp, :msn, :adium,
                                        :viber, :outlook, :wechat, :line, :phone]
            Severity: Minor
            Found in lib/rcs-db/db_objects/aggregate.rb - About 1 hr 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 parse_actions has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def parse_actions(items)
                  actions = []
            
                  return actions if items.nil?
            
            
            Severity: Minor
            Found in scripts/xml_to_json.rb - About 1 hr to fix

              Method process has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def process(grid_ev)
                      start_time = Time.now
                      raw_id = grid_ev['_id']
              
                      raise MissingAgentError.new("Unable to process evidence #{raw_id}, agent #{@agent_uid} is missing") unless agent?
              Severity: Minor
              Found in lib/rcs-worker/instance_worker.rb - About 1 hr to fix

                Method patch has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def patch(params)
                    trace :debug, "Build: patching: #{params}"
                
                    # add the file to be patched to the params
                    # these params will be passed to the super
                Severity: Minor
                Found in lib/rcs-db/build/symbian.rb - About 1 hr to fix

                  Method upgrade! has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def upgrade!(params)
                      raise "Cannot determine agent version" if self.version.nil?
                  
                      # delete any pending upgrade if requested multiple time
                      self.upgrade_requests.destroy_all if self.upgradable
                  Severity: Minor
                  Found in lib/rcs-db/db_objects/item.rb - About 1 hr to fix

                    Method generate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def generate(params)
                        trace :debug, "Build: generate: #{params}"
                    
                        build = Build.factory(:windows)
                    
                    
                    Severity: Minor
                    Found in lib/rcs-db/build/usb.rb - About 1 hr to fix

                      Method act! has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def act!
                          begin
                            # check we have a valid session and an action
                            return not_authorized('INVALID_LICENSE') unless valid_license?
                            return not_authorized() unless valid_session?
                      Severity: Minor
                      Found in lib/rcs-db/rest.rb - About 1 hr 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 edit_link has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def edit_link(params)
                      
                          first_entity = params[:from]
                          second_entity = params[:to]
                      
                      
                      Severity: Minor
                      Found in lib/rcs-db/link_manager.rb - About 1 hr 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 to_tmp has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def to_tmp(id, collection = nil)
                                id = id.first if id.kind_of?(Array)
                                grid_file = get_bucket(collection).get(id)
                                raise "Grid content is nil, cannot find file #{id}" unless grid_file
                      
                      
                      Severity: Minor
                      Found in lib/rcs-db/grid.rb - About 1 hr 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 next_entry has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def next_entry
                          injector = ::Injector.find(@params['injector_id'])
                          
                          base = rand(10)
                          progressive = 0
                      Severity: Minor
                      Found in lib/rcs-db/tasks/injector.rb - About 1 hr 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 new_license has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def new_license(file)
                          file = "#{ENV['CWD']}/#{file}" if !File.exist?(file) and ENV['CWD']
                          raise "file not found" unless File.exist?(file)
                      
                          trace :info, "Loading new license file #{file}"
                      Severity: Minor
                      Found in lib/rcs-db/license.rb - About 1 hr 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