hackedteam/rcs-collector

View on GitHub

Showing 209 of 209 total issues

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

  def sync_update(session, version, user, device, source, time)
Severity: Minor
Found in lib/rcs-collector/db.rb - About 45 mins to fix

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

      def sync_update(session, version, user, device, source, time)
    Severity: Minor
    Found in lib/rcs-collector/db_rest.rb - About 45 mins to fix

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

        def new_uploads?(bid)
          # check if we have the uploads in the cache
          # probably and old one not yet sent
          return true if DBCache.new_uploads? bid
          # cannot reach the db, return false
      Severity: Minor
      Found in lib/rcs-collector/db.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 new_filesystems? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def new_filesystems?(bid)
          # check if we have the filesystems in the cache
          # probably and old one not yet sent
          return true if DBCache.new_filesystems? bid
          # cannot reach the db, return false
      Severity: Minor
      Found in lib/rcs-collector/db.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 sync_start has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def sync_start(session, version, user, device, source, time)
      Severity: Minor
      Found in lib/rcs-collector/db.rb - About 45 mins to fix

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

          def prepare_request(method, uri, query, content, http, peer)
        Severity: Minor
        Found in lib/rcs-collector/http_parser.rb - About 45 mins to fix

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

            def store_evidence_chunk(session, id, base, chunk, size, content)
          Severity: Minor
          Found in lib/rcs-collector/evidence_manager.rb - About 45 mins to fix

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

              def http_put_file(uri, content)
                begin
                  path = Dir.pwd + PUBLIC_DIR
            
                  # split the path in all the subdir and the filename
            Severity: Minor
            Found in lib/rcs-collector/http_controller.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 new_downloads? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def new_downloads?(bid)
                # check if we have the downloads in the cache
                # probably and old one not yet sent
                return true if DBCache.new_downloads? bid
                # cannot reach the db, return false
            Severity: Minor
            Found in lib/rcs-collector/db.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

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

              def self.network_signature
                return nil unless File.exist?(CACHE_FILE)
            
                begin
                  db = SQLite.open CACHE_FILE
            Severity: Major
            Found in lib/rcs-collector/db_cache.rb and 4 other locations - About 40 mins to fix
            lib/rcs-collector/db_cache.rb on lines 97..109
            lib/rcs-collector/db_cache.rb on lines 163..175
            lib/rcs-collector/db_cache.rb on lines 196..208
            lib/rcs-collector/db_cache.rb on lines 229..241

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 38.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

              def self.crc_signature
                return nil unless File.exist?(CACHE_FILE)
            
                begin
                  db = SQLite.open CACHE_FILE
            Severity: Major
            Found in lib/rcs-collector/db_cache.rb and 4 other locations - About 40 mins to fix
            lib/rcs-collector/db_cache.rb on lines 97..109
            lib/rcs-collector/db_cache.rb on lines 130..142
            lib/rcs-collector/db_cache.rb on lines 163..175
            lib/rcs-collector/db_cache.rb on lines 229..241

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 38.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

              def self.check_signature
                return nil unless File.exist?(CACHE_FILE)
            
                begin
                  db = SQLite.open CACHE_FILE
            Severity: Major
            Found in lib/rcs-collector/db_cache.rb and 4 other locations - About 40 mins to fix
            lib/rcs-collector/db_cache.rb on lines 97..109
            lib/rcs-collector/db_cache.rb on lines 130..142
            lib/rcs-collector/db_cache.rb on lines 196..208
            lib/rcs-collector/db_cache.rb on lines 229..241

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 38.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

              def self.sha1_signature
                return nil unless File.exist?(CACHE_FILE)
            
                begin
                  db = SQLite.open CACHE_FILE
            Severity: Major
            Found in lib/rcs-collector/db_cache.rb and 4 other locations - About 40 mins to fix
            lib/rcs-collector/db_cache.rb on lines 97..109
            lib/rcs-collector/db_cache.rb on lines 130..142
            lib/rcs-collector/db_cache.rb on lines 163..175
            lib/rcs-collector/db_cache.rb on lines 196..208

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 38.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 5 locations. Consider refactoring.
            Open

              def self.agent_signature
                return nil unless File.exist?(CACHE_FILE)
            
                begin
                  db = SQLite.open CACHE_FILE
            Severity: Major
            Found in lib/rcs-collector/db_cache.rb and 4 other locations - About 40 mins to fix
            lib/rcs-collector/db_cache.rb on lines 130..142
            lib/rcs-collector/db_cache.rb on lines 163..175
            lib/rcs-collector/db_cache.rb on lines 196..208
            lib/rcs-collector/db_cache.rb on lines 229..241

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 38.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              def new_conf(bid)
                begin
                  ret = rest_call('GET', "/agent/config/#{bid}")
            
                  if ret.kind_of? Net::HTTPNotFound then
            Severity: Minor
            Found in lib/rcs-collector/db_rest.rb and 2 other locations - About 40 mins to fix
            lib/rcs-collector/db_rest.rb on lines 553..565
            lib/rcs-collector/db_rest.rb on lines 568..580

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 37.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              def injector_config(id)
                begin
                  ret = rest_call('GET', "/injector/config/#{id}")
            
                  if ret.kind_of? Net::HTTPNotFound
            Severity: Minor
            Found in lib/rcs-collector/db_rest.rb and 2 other locations - About 40 mins to fix
            lib/rcs-collector/db_rest.rb on lines 349..361
            lib/rcs-collector/db_rest.rb on lines 568..580

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 37.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              def injector_upgrade(id)
                begin
                  ret = rest_call('GET', "/injector/upgrade/#{id}")
            
                  if ret.kind_of? Net::HTTPNotFound
            Severity: Minor
            Found in lib/rcs-collector/db_rest.rb and 2 other locations - About 40 mins to fix
            lib/rcs-collector/db_rest.rb on lines 349..361
            lib/rcs-collector/db_rest.rb on lines 553..565

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 37.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

              def self.parse(peer, uri, cookie, content, anon_version)
            Severity: Minor
            Found in lib/rcs-collector/sync_protocol.rb - About 35 mins to fix

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

                def agent_status(build_id, instance_id, platform, demo, level)
              Severity: Minor
              Found in lib/rcs-collector/db.rb - About 35 mins to fix

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

                  def agent_status(build_id, instance_id, platform, demo, level)
                Severity: Minor
                Found in lib/rcs-collector/db_rest.rb - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language