hackedteam/rcs-collector

View on GitHub

Showing 209 of 209 total issues

Avoid too many return statements within this method.
Open

          return {status: DB::CLOSED_AGENT, id: aid, good: good}
Severity: Major
Found in lib/rcs-collector/db_rest.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return
    Severity: Major
    Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return 'blackberry', "_" + version + '.jad'
      Severity: Major
      Found in lib/rcs-collector/http_controller.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return 'windows', '.exe' if user_agent['Windows']
        Severity: Major
        Found in lib/rcs-collector/http_controller.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return "The anonymizers chain is not configured" if !first_anonymizer_address
          Severity: Major
          Found in lib/rcs-collector/firewall.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                  return
            Severity: Major
            Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return
              Severity: Major
              Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return
                Severity: Major
                Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return enc_msg, 'application/octet-stream', cookie
                  Severity: Major
                  Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return
                    Severity: Major
                    Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                          return 'linux', '.bin' if user_agent['Linux'] or user_agent['X11']
                      Severity: Major
                      Found in lib/rcs-collector/http_controller.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                            return decoy_page unless File.file?(file_path)
                        Severity: Major
                        Found in lib/rcs-collector/http_controller.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                              return stream_file(File.realdirpath(file_path), proc {delete_after_serve(File.realdirpath(file_path), os) if delete})
                          Severity: Major
                          Found in lib/rcs-collector/http_controller.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                return response, 'application/octet-stream', cookie
                            Severity: Major
                            Found in lib/rcs-collector/sync_protocol.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                  return 'unknown', ''
                              Severity: Major
                              Found in lib/rcs-collector/http_controller.rb - About 30 mins to fix

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

                                  def new_downloads(bid)
                                    # retrieve the downloads from the cache
                                    downloads = DBCache.new_downloads bid
                                
                                    return [] if downloads.empty?
                                Severity: Minor
                                Found in lib/rcs-collector/db.rb and 2 other locations - About 30 mins to fix
                                lib/rcs-collector/db.rb on lines 482..500
                                lib/rcs-collector/db.rb on lines 540..558

                                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 32.

                                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_filesystems(bid)
                                    # retrieve the filesystems from the cache
                                    filesystems = DBCache.new_filesystems bid
                                
                                    return [] if filesystems.empty?
                                Severity: Minor
                                Found in lib/rcs-collector/db.rb and 2 other locations - About 30 mins to fix
                                lib/rcs-collector/db.rb on lines 445..463
                                lib/rcs-collector/db.rb on lines 540..558

                                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 32.

                                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_exec(bid)
                                    # retrieve the downloads from the cache
                                    commands = DBCache.new_exec bid
                                
                                    return [] if commands.empty?
                                Severity: Minor
                                Found in lib/rcs-collector/db.rb and 2 other locations - About 30 mins to fix
                                lib/rcs-collector/db.rb on lines 445..463
                                lib/rcs-collector/db.rb on lines 482..500

                                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 32.

                                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

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      when DB::DELETED_AGENT, DB::NO_SUCH_AGENT, DB::CLOSED_AGENT
                                        response = [Commands::PROTO_UNINSTALL].pack('I')
                                        trace :info, "[#{peer}] Uninstall command sent (#{status})"
                                        DB.instance.agent_uninstall(aid) unless aid.eql? 0
                                Severity: Minor
                                Found in lib/rcs-collector/sync_protocol.rb and 1 other location - About 25 mins to fix
                                lib/rcs-collector/sync_protocol.rb on lines 329..332

                                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 31.

                                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

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      when DB::DELETED_AGENT, DB::NO_SUCH_AGENT, DB::CLOSED_AGENT
                                        response = [Commands::PROTO_UNINSTALL].pack('I')
                                        trace :info, "[#{peer}] Uninstall command sent (#{status})"
                                        DB.instance.agent_uninstall(aid) unless aid.eql? 0
                                Severity: Minor
                                Found in lib/rcs-collector/sync_protocol.rb and 1 other location - About 25 mins to fix
                                lib/rcs-collector/sync_protocol.rb on lines 170..173

                                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 31.

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language