millerf/django-channels-jsonrpc

View on GitHub
example/django_example/tests.py

Summary

Maintainability
F
4 days
Test Coverage

File tests.py has 442 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from datetime import datetime
from channels_jsonrpc import JsonRpcConsumerTest, JsonRpcException
from channels.tests import ChannelTestCase, HttpClient
from .consumer import MyJsonRpcWebsocketConsumerTest, DjangoJsonRpcWebsocketConsumerTest

Severity: Minor
Found in example/django_example/tests.py - About 6 hrs to fix

    TestsJsonRPCWebsocketConsumer has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TestsJsonRPCWebsocketConsumer(ChannelTestCase):
    
        def test_connection(self):
            # Test connection
            client = HttpClient()
    Severity: Minor
    Found in example/django_example/tests.py - About 3 hrs to fix

      Function test_group_notifications has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def test_group_notifications(self):
              from channels import Group
      
              @MyJsonRpcWebsocketConsumerTest.rpc_method()
              def add_client_to_group(group_name, **kwargs):
      Severity: Minor
      Found in example/django_example/tests.py - About 1 hr to fix

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

                def thread_test():
                    for _i in range(0, 10000):
                        _message = SpoofMessage()
                        _message.channel.name = "websocket.test"
                        _message.payload = "test%s" % _i
        Severity: Major
        Found in example/django_example/tests.py and 1 other location - About 4 hrs to fix
        example/django_example/tests.py on lines 413..419

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

        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

                for i in range(0, 10000):
                    _message = SpoofMessage()
                    _message.channel.name = "websocket.test"
                    _message.payload = "test%s" % i
                    res = MyJsonRpcWebsocketConsumerTest._JsonRpcConsumer__process(
        Severity: Major
        Found in example/django_example/tests.py and 1 other location - About 4 hrs to fix
        example/django_example/tests.py on lines 401..408

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

        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 test_id_on_good_request(self):
                # Test that parsing a ping request works
                client = HttpClient()
        
                client.send_and_consume(u'websocket.receive',
        Severity: Major
        Found in example/django_example/tests.py and 1 other location - About 2 hrs to fix
        example/django_example/tests.py on lines 182..189

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

        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 test_id_on_errored_request(self):
                # Test that parsing a ping request works
                client = HttpClient()
        
                client.send_and_consume(u'websocket.receive',
        Severity: Major
        Found in example/django_example/tests.py and 1 other location - About 2 hrs to fix
        example/django_example/tests.py on lines 173..180

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

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

                self.assertEqual(client.receive()['error'], {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                                             u'message': JsonRpcConsumerTest.errors[
                                                                 JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'], {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                                             u'message': JsonRpcConsumerTest.errors[
                                                                 JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'], {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                                             u'message': JsonRpcConsumerTest.errors[
                                                                 JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'],
                                 {u'code': JsonRpcConsumerTest.PARSE_ERROR,
                                  u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.PARSE_ERROR]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'],
                                 {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                 u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91

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

                self.assertEqual(client.receive()['error'],
                                 {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                 u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'], {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                                             u'message': JsonRpcConsumerTest.errors[
                                                                 JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'],
                                 {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                 u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'],
                                 {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                 u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'], {u'code': JsonRpcConsumerTest.METHOD_NOT_FOUND,
                                                             u'message': JsonRpcConsumerTest.errors[
                                                                 JsonRpcConsumerTest.METHOD_NOT_FOUND]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 57..59
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                self.assertEqual(client.receive()['error'],
                                 {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                 u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 10 other locations - About 1 hr to fix
        example/django_example/tests.py on lines 41..43
        example/django_example/tests.py on lines 46..48
        example/django_example/tests.py on lines 51..53
        example/django_example/tests.py on lines 63..65
        example/django_example/tests.py on lines 69..71
        example/django_example/tests.py on lines 74..76
        example/django_example/tests.py on lines 79..81
        example/django_example/tests.py on lines 84..86
        example/django_example/tests.py on lines 89..91
        example/django_example/tests.py on lines 109..111

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

                @MyJsonRpcWebsocketConsumerTest.rpc_method()
                def ping_set_session(**kwargs):
                    original_message = kwargs["original_message"]
                    original_message.channel_session["test"] = True
                    return "pong_set_session"
        Severity: Minor
        Found in example/django_example/tests.py and 1 other location - About 55 mins to fix
        example/django_example/tests.py on lines 326..330

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

                @MyJsonRpcWebsocketConsumerTest.rpc_method()
                def ping_set_session2(**kwargs):
                    original_message = kwargs["original_message"]
                    original_message.channel_session["test"] = True
                    return "pong_set_session2"
        Severity: Minor
        Found in example/django_example/tests.py and 1 other location - About 55 mins to fix
        example/django_example/tests.py on lines 302..306

        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

                self.assertEqual(msg['error'], {u'code': JsonRpcConsumerTest.METHOD_NOT_FOUND,
                                                u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.METHOD_NOT_FOUND]})
        Severity: Major
        Found in example/django_example/tests.py and 2 other locations - About 40 mins to fix
        example/django_example/tests.py on lines 29..31
        example/django_example/tests.py on lines 160..162

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

        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

                self.assertEqual(response['error'],
                                 {u'code': JsonRpcConsumerTest.INVALID_REQUEST,
                                 u'message': JsonRpcConsumerTest.errors[JsonRpcConsumerTest.INVALID_REQUEST]})
        Severity: Major
        Found in example/django_example/tests.py and 2 other locations - About 40 mins to fix
        example/django_example/tests.py on lines 100..101
        example/django_example/tests.py on lines 160..162

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

        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

                self.assertEqual(msg['error'], {u'code': JsonRpcConsumerTest.INVALID_PARAMS,
                                                             u'message': JsonRpcConsumerTest.errors[
                                                                 JsonRpcConsumerTest.INVALID_PARAMS]})
        Severity: Major
        Found in example/django_example/tests.py and 2 other locations - About 40 mins to fix
        example/django_example/tests.py on lines 29..31
        example/django_example/tests.py on lines 100..101

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

        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