ronin-rb/ronin-support-web

View on GitHub
lib/ronin/support/web/websocket/mixin.rb

Summary

Maintainability
B
4 hrs
Test Coverage

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

          def ws_connect_and_send(data,host,port=80, type: :text, ssl: {}, **kwargs,&block)
Severity: Minor
Found in lib/ronin/support/web/websocket/mixin.rb - About 35 mins to fix

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

              def wss_connect_and_send(data,host,port=443, type: :text, ssl: {}, **kwargs,&block)
    Severity: Minor
    Found in lib/ronin/support/web/websocket/mixin.rb - About 35 mins to fix

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

                def wss_connect_and_send(data,host,port=443, type: :text, ssl: {}, **kwargs,&block)
                  uri = URI::WSS.build(host: host, port: port)
      
                  WebSocket.connect_and_send(data,uri, type: type, ssl: ssl, **kwargs, &block)
      Severity: Minor
      Found in lib/ronin/support/web/websocket/mixin.rb and 1 other location - About 25 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 447..450

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

      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

                def ws_connect_and_send(data,host,port=80, type: :text, ssl: {}, **kwargs,&block)
                  uri = URI::WS.build(host: host, port: port)
      
                  WebSocket.connect_and_send(data,uri, type: type, ssl: ssl, **kwargs,&block)
      Severity: Minor
      Found in lib/ronin/support/web/websocket/mixin.rb and 1 other location - About 25 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 609..612

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

      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

                def ws_send(data,host,port=80, type: :text, ssl: {}, **kwargs)
                  uri = URI::WS.build(host: host, port: port)
      
                  WebSocket.send(data,uri, type: type, ssl: ssl, **kwargs)
      Severity: Minor
      Found in lib/ronin/support/web/websocket/mixin.rb and 1 other location - About 20 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 646..649

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

      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

                def wss_send(data,host,port=443, type: :text, ssl: {}, **kwargs)
                  uri = URI::WSS.build(host: host, port: port)
      
                  WebSocket.send(data,uri, type: type, ssl: ssl, **kwargs)
      Severity: Minor
      Found in lib/ronin/support/web/websocket/mixin.rb and 1 other location - About 20 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 484..487

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

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

                def ws_accept(host,port=80, ssl: {}, **kwargs,&block)
                  uri = URI::WS.build(host: host, port: port)
      
                  WebSocket.accept(uri, ssl: ssl, **kwargs,&block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

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

                def ws_server(host,port=80, ssl: {}, **kwargs,&block)
                  uri = URI::WS.build(host: host, port: port)
      
                  WebSocket.server(uri, ssl: ssl, **kwargs,&block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

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

                def ws_connect(host,port=80, ssl: {}, **kwargs,&block)
                  uri = URI::WS.build(host: host, port: port)
      
                  WebSocket.connect(uri, ssl: ssl, **kwargs, &block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

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

                def ws_server_loop(host,port=80, ssl: {}, **kwargs,&block)
                  uri = URI::WS.build(host: host, port: port)
      
                  WebSocket.server_loop(uri, ssl: ssl, **kwargs,&block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

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

                def wss_server(host,port=443, ssl: {}, **kwargs,&block)
                  uri = URI::WSS.build(host: host, port: port)
      
                  WebSocket.server(uri, ssl: ssl, **kwargs,&block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

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

                def wss_connect(host,port=443, ssl: {}, **kwargs,&block)
                  uri = URI::WSS.build(host: host, port: port)
      
                  WebSocket.connect(uri, ssl: ssl, **kwargs, &block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

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

                def wss_accept(host,port=443, ssl: {}, **kwargs,&block)
                  uri = URI::WSS.build(host: host, port: port)
      
                  WebSocket.accept(uri, ssl: ssl, **kwargs,&block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 839..842

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

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

                def wss_server_loop(host,port=443, ssl: {}, **kwargs,&block)
                  uri = URI::WSS.build(host: host, port: port)
      
                  WebSocket.server_loop(uri, ssl: ssl, **kwargs,&block)
      Severity: Major
      Found in lib/ronin/support/web/websocket/mixin.rb and 7 other locations - About 15 mins to fix
      lib/ronin/support/web/websocket/mixin.rb on lines 402..405
      lib/ronin/support/web/websocket/mixin.rb on lines 564..567
      lib/ronin/support/web/websocket/mixin.rb on lines 684..687
      lib/ronin/support/web/websocket/mixin.rb on lines 723..726
      lib/ronin/support/web/websocket/mixin.rb on lines 762..765
      lib/ronin/support/web/websocket/mixin.rb on lines 800..803
      lib/ronin/support/web/websocket/mixin.rb on lines 879..882

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

      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

      There are no issues that match your filters.

      Category
      Status