jacquev6/LowVoltage

View on GitHub

Showing 53 of 329 total issues

File return_types.py has 643 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf8

# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>

import datetime
Severity: Major
Found in LowVoltage/actions/return_types.py - About 1 day to fix

    File update_item.py has 584 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # coding: utf8
    
    # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
    
    """
    Severity: Major
    Found in LowVoltage/actions/update_item.py - About 1 day to fix

      File query.py has 552 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # coding: utf8
      
      # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
      
      """
      Severity: Major
      Found in LowVoltage/actions/query.py - About 1 day to fix

        File update_table.py has 493 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # coding: utf8
        
        # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
        
        """
        Severity: Minor
        Found in LowVoltage/actions/update_table.py - About 7 hrs to fix

          File create_table.py has 491 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # coding: utf8
          
          # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
          
          """
          Severity: Minor
          Found in LowVoltage/actions/create_table.py - About 7 hrs to fix

            File connection.py has 436 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # coding: utf8
            
            # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
            
            import datetime
            Severity: Minor
            Found in LowVoltage/connection/connection.py - About 6 hrs to fix

              File batch_get_item.py has 431 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # coding: utf8
              
              # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
              
              """
              Severity: Minor
              Found in LowVoltage/actions/batch_get_item.py - About 6 hrs to fix

                File batch_write_item.py has 423 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # coding: utf8
                
                # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
                
                """
                Severity: Minor
                Found in LowVoltage/actions/batch_write_item.py - About 6 hrs to fix

                  File delete_item.py has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # coding: utf8
                  
                  # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
                  
                  """
                  Severity: Minor
                  Found in LowVoltage/actions/delete_item.py - About 4 hrs to fix

                    ConversionUnitTests has 32 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class ConversionUnitTests(_tst.UnitTests):
                        def test_convert_unicode_value_to_db(self):
                            self.assertEqual(_convert_value_to_db(u"éoà"), {"S": u"éoà"})
                    
                        def test_convert_bytes_value_to_db(self):
                    Severity: Minor
                    Found in LowVoltage/actions/conversion.py - About 4 hrs to fix

                      File put_item.py has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # coding: utf8
                      
                      # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
                      """
                      When given a :class:`PutItem`, the connection will return a :class:`PutItemResponse`:
                      Severity: Minor
                      Found in LowVoltage/actions/put_item.py - About 4 hrs to fix

                        File next_gen_mixins.py has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # coding: utf8
                        
                        # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
                        
                        import numbers
                        Severity: Minor
                        Found in LowVoltage/actions/next_gen_mixins.py - About 3 hrs to fix

                          UpdateTableUnitTests has 30 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class UpdateTableUnitTests(_tst.UnitTests):
                              def test_name(self):
                                  self.assertEqual(UpdateTable("Foo").name, "UpdateTable")
                          
                              def test_constructor(self):
                          Severity: Minor
                          Found in LowVoltage/actions/update_table.py - About 3 hrs to fix

                            File scan.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # coding: utf8
                            
                            # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
                            
                            """
                            Severity: Minor
                            Found in LowVoltage/actions/scan.py - About 3 hrs to fix

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

                              class Query(Action):
                                  """
                                  The `Query request <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#API_Query_RequestParameters>`__.
                                  """
                              
                              
                              Severity: Minor
                              Found in LowVoltage/actions/query.py - About 3 hrs to fix

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

                                class QueryUnitTests(_tst.UnitTests):
                                    def test_name(self):
                                        self.assertEqual(Query("Aaa").name, "Query")
                                
                                    def test_table_name(self):
                                Severity: Minor
                                Found in LowVoltage/actions/query.py - About 3 hrs to fix

                                  CreateTableUnitTests has 26 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class CreateTableUnitTests(_tst.UnitTests):
                                      def test_name(self):
                                          self.assertEqual(CreateTable("Foo").name, "CreateTable")
                                  
                                      def test_constructor(self):
                                  Severity: Minor
                                  Found in LowVoltage/actions/create_table.py - About 3 hrs to fix

                                    Function variadic has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def variadic(typ):
                                        """
                                        Decorator taking a variadic function and making a very-variadic function from it:
                                        a function that can be called with a variable number of iterables of arguments.
                                    
                                    
                                    Severity: Minor
                                    Found in LowVoltage/variadic.py - About 2 hrs to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    UpdateItemUnitTests has 23 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class UpdateItemUnitTests(_tst.UnitTests):
                                        def test_name(self):
                                            self.assertEqual(UpdateItem("Table", {"hash": 42}).name, "UpdateItem")
                                    
                                        def test_table_name_and_key(self):
                                    Severity: Minor
                                    Found in LowVoltage/actions/update_item.py - About 2 hrs to fix

                                      Function _convert_value_to_db has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def _convert_value_to_db(value):
                                          if isinstance(value, unicode):
                                              return {"S": value}
                                          elif isinstance(value, bytes):
                                              return {"B": base64.b64encode(value).decode("utf8")}
                                      Severity: Minor
                                      Found in LowVoltage/actions/conversion.py - About 2 hrs to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language