ronin-rb/ronin-support-web

View on GitHub

Showing 27 of 27 total issues

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

        def get_json(url,**kwargs)
          response = get(url,**kwargs)

          unless response.content_type.include?('application/json')
            raise(ContentTypeError,"response 'Content-Type' was not 'application/json': #{response.content_type.inspect}")
Severity: Minor
Found in lib/ronin/support/web/agent.rb and 1 other location - About 15 mins to fix
lib/ronin/support/web/agent.rb on lines 1387..1394

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

        def post_html(url,**kwargs)
          response = post(url,**kwargs)

          unless response.content_type.include?('text/html')
            raise(ContentTypeError,"response 'Content-Type' was not 'text/html': #{response.content_type.inspect}")
Severity: Minor
Found in lib/ronin/support/web/agent.rb and 3 other locations - About 15 mins to fix
lib/ronin/support/web/agent.rb on lines 1124..1131
lib/ronin/support/web/agent.rb on lines 1163..1170
lib/ronin/support/web/agent.rb on lines 1341..1348

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

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

        def get_xml(url,**kwargs)
          response = get(url,**kwargs)

          unless response.content_type.include?('text/xml')
            raise(ContentTypeError,"response 'Content-Type' was not 'text/xml': #{response.content_type.inspect}")
Severity: Minor
Found in lib/ronin/support/web/agent.rb and 3 other locations - About 15 mins to fix
lib/ronin/support/web/agent.rb on lines 1124..1131
lib/ronin/support/web/agent.rb on lines 1299..1306
lib/ronin/support/web/agent.rb on lines 1341..1348

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

Severity
Category
Status
Source
Language