Showing 96 of 96 total issues

File client.py has 580 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
Cluster Supporting Redis Client

"""
import collections
Severity: Major
Found in tredis/client.py - About 1 day to fix

    File strings.py has 535 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Redis String Commands Mixin"""
    
    # Python 2 support for ascii()
    if 'ascii' not in dir(__builtins__):  # pragma: nocover
        from tredis.compat import ascii
    Severity: Major
    Found in tredis/strings.py - About 1 day to fix

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

          @testing.gen_test
          def test_sinterstore(self):
              key1, key2, key3, value1, value2, value3 = self.uuid4(6)
              result = yield self.client.sadd(key1, value1, value2)
              self.assertTrue(result)
      Severity: Major
      Found in tests/sets_tests.py and 1 other location - About 1 day to fix
      tests/sets_tests.py on lines 48..58

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

      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

          @testing.gen_test
          def test_sdiffstore(self):
              key1, key2, key3, value1, value2, value3 = self.uuid4(6)
              result = yield self.client.sadd(key1, value1, value2)
              self.assertTrue(result)
      Severity: Major
      Found in tests/sets_tests.py and 1 other location - About 1 day to fix
      tests/sets_tests.py on lines 70..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 132.

      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

      File keys.py has 527 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Redis Key Commands Mixin"""
      from tornado import concurrent
      
      # Python 2 support for ascii()
      if 'ascii' not in dir(__builtins__):  # pragma: nocover
      Severity: Major
      Found in tredis/keys.py - About 1 day to fix

        File keys_tests.py has 523 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import logging
        import mock
        import os
        import time
        import uuid
        Severity: Major
        Found in tests/keys_tests.py - About 1 day to fix

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

              @testing.gen_test
              def test_spop(self):
                  key, value1, value2, value3 = self.uuid4(4)
                  values = [value1, value2, value3]
                  result = yield self.client.sadd(key, *values)
          Severity: Major
          Found in tests/sets_tests.py and 1 other location - About 7 hrs to fix
          tests/sets_tests.py on lines 137..146

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

          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

              @testing.gen_test
              def test_srandmember(self):
                  key, value1, value2, value3 = self.uuid4(4)
                  values = [value1, value2, value3]
                  result = yield self.client.sadd(key, *values)
          Severity: Major
          Found in tests/sets_tests.py and 1 other location - About 7 hrs to fix
          tests/sets_tests.py on lines 126..135

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

          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

          StringTests has 50 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class StringTests(base.AsyncTestCase):
          
              @testing.gen_test
              def test_append(self):
                  key, value1, value2 = self.uuid4(3)
          Severity: Minor
          Found in tests/strings_tests.py - About 7 hrs to fix

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

                @testing.gen_test
                def test_sdiff(self):
                    key1, key2, value1, value2, value3 = self.uuid4(5)
                    result = yield self.client.sadd(key1, value1, value2)
                    self.assertTrue(result)
            Severity: Major
            Found in tests/sets_tests.py and 1 other location - About 6 hrs to fix
            tests/sets_tests.py on lines 60..68

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

            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

                @testing.gen_test
                def test_sinter(self):
                    key1, key2, value1, value2, value3 = self.uuid4(5)
                    result = yield self.client.sadd(key1, value1, value2)
                    self.assertTrue(result)
            Severity: Major
            Found in tests/sets_tests.py and 1 other location - About 6 hrs to fix
            tests/sets_tests.py on lines 38..46

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

            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

            File strings_tests.py has 418 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            from tornado import gen
            from tornado import testing
            
            import tredis
            
            
            Severity: Minor
            Found in tests/strings_tests.py - About 6 hrs to fix

              KeyCommandTests has 44 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class KeyCommandTests(base.AsyncTestCase):
              
                  @testing.gen_test
                  def test_delete(self):
                      key, value = self.uuid4(2)
              Severity: Minor
              Found in tests/keys_tests.py - About 6 hrs to fix

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

                        if start is not None and end is None:
                            raise ValueError('Can not specify start without an end')
                        elif start is None and end is not None:
                            raise ValueError('Can not specify start without an end')
                        elif start is not None and end is not None:
                Severity: Major
                Found in tredis/strings.py and 1 other location - About 5 hrs to fix
                tredis/strings.py on lines 86..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 97.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                        if start is not None and end is None:
                            raise ValueError('Can not specify start without an end')
                        elif start is None and end is not None:
                            raise ValueError('Can not specify start without an end')
                        elif start is not None and end is not None:
                Severity: Major
                Found in tredis/strings.py and 1 other location - About 5 hrs to fix
                tredis/strings.py on lines 198..203

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

                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

                    @testing.gen_test
                    def test_delete_multi(self):
                        key1, key2, value = self.uuid4(3)
                        result = yield self.expiring_set(key1, value)
                        self.assertTrue(result)
                Severity: Major
                Found in tests/keys_tests.py and 1 other location - About 5 hrs to fix
                tests/keys_tests.py on lines 299..307

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

                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

                    @testing.gen_test
                    def test_renamenx_failure(self):
                        key1, key2, value = self.uuid4(3)
                        result = yield self.expiring_set(key1, value)
                        self.assertTrue(result)
                Severity: Major
                Found in tests/keys_tests.py and 1 other location - About 5 hrs to fix
                tests/keys_tests.py on lines 25..33

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

                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

                    @testing.gen_test
                    def test_zrangebyscore_count(self):
                        key, value1, value2, value3 = self.uuid4(4)
                        result = yield self.client.zadd(key, '1', value1, '2', value2,
                                                        '3', value3)
                Severity: Major
                Found in tests/sortedsets_tests.py and 1 other location - About 5 hrs to fix
                tests/sortedsets_tests.py on lines 115..123

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

                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

                    @testing.gen_test
                    def test_zrangebyscore_offset(self):
                        key, value1, value2, value3 = self.uuid4(4)
                        result = yield self.client.zadd(key, '1', value1, '2', value2,
                                                        '3', value3)
                Severity: Major
                Found in tests/sortedsets_tests.py and 1 other location - About 5 hrs to fix
                tests/sortedsets_tests.py on lines 125..133

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

                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

                    @testing.gen_test
                    def test_zadd_ch(self):
                        key, value1, value2, value3 = self.uuid4(4)
                        result = yield self.client.zadd(key, '1', value1, '2', value2)
                        self.assertEqual(result, 2)
                Severity: Major
                Found in tests/sortedsets_tests.py and 1 other location - About 5 hrs to fix
                tests/sortedsets_tests.py on lines 47..54

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

                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