hackedteam/poc-x

View on GitHub

Showing 11 of 11 total issues

Method process_request has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

def process_request(client)
  loop do
    begin
      req = client.gets  
      next unless req
Severity: Minor
Found in socks.rb - About 2 hrs 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 15 (exceeds 5 allowed). Consider refactoring.
Open

  def initialize(filename, options = {}, &block)
    @filename = filename
    @block = block
    @path = File.join(self.class.base_path, filename)
    @unique = options[:unique]
Severity: Minor
Found in tailer.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 bootstrap_events has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def bootstrap_events(client)
  log "SENDING BOOTSTRAP EVENTS..."

  reply client, "650 NOTICE Bootstrapped 5%: Connecting to directory server.\r\n"
  sleep 0.1
Severity: Minor
Found in socks.rb - About 1 hr to fix

    Method process_request has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def process_request(client)
      loop do
        begin
          req = client.gets  
          next unless req
    Severity: Minor
    Found in socks.rb - About 1 hr to fix

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

              if flow.request.port == 443:
                  file.write("HTTPS " + str(flow.request.headers["Host"][0]) + "\n")
      Severity: Major
      Found in inject.py and 1 other location - About 1 hr to fix
      inject.py on lines 20..23

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

      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

      Function initTailWindows has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function initTailWindows(){
          $('.stream').each(function(){
            var container = $(this);
            var params = container.data();
      
      
      Severity: Minor
      Found in public/script.js - About 1 hr to fix

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

        def process_getinfo(client, req)
          if req['status/bootstrap-phase']
            reply client, @reply_bootstrap_phase
            reply client, @reply_250OK
            @vent.set
        Severity: Minor
        Found in socks.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

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

          if req['Socks4Proxy']
            reply client, @reply_Socks4Proxy
          elsif req['Socks5Proxy']
            reply client, @reply_Socks5Proxy
          elsif req['HTTPSProxy']
        Severity: Minor
        Found in socks.rb and 1 other location - About 55 mins to fix
        socks.rb on lines 66..80

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

        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 2 locations. Consider refactoring.
        Open

          elsif req['Socks4Proxy']
            reply client, @reply_Socks4Proxy
          elsif req['Socks5Proxy']
            reply client, @reply_Socks5Proxy
          elsif req['HTTPSProxy']
        Severity: Minor
        Found in socks.rb and 1 other location - About 55 mins to fix
        socks.rb on lines 84..98

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

        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

        Function request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def request(ctx, flow):
            """
                Called when a client request has been received.
            """
            ctx.log("request")
        Severity: Minor
        Found in inject.py - 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 process_getconf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def process_getconf(client, req)
          if req['Socks4Proxy']
            reply client, @reply_Socks4Proxy
          elsif req['Socks5Proxy']
            reply client, @reply_Socks5Proxy
        Severity: Minor
        Found in socks.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

        Severity
        Category
        Status
        Source
        Language