tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File dynamic_ragged_shape_test.py has 3693 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 1 wk to fix

    DynamicRaggedShapeTest has 133 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class DynamicRaggedShapeTest(test_util.TensorFlowTestCase,
                                 parameterized.TestCase):
    
      def assertRowPartitionEq(self,
                               x: RowPartition,
    Severity: Major
    Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 2 days to fix

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

      class DynamicRaggedShapeSpecTest(parameterized.TestCase):
      
        def assertRowPartitionSpecEqual(self,
                                        a: RowPartitionSpec,
                                        b: RowPartitionSpec,
      Severity: Minor
      Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 4 hrs to fix

        Function testAddShape has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def testAddShape(self,
        Severity: Minor
        Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

          Function test_merge_dims has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def test_merge_dims(self, lengths, num_row_partitions, outer_axis, inner_axis,
          Severity: Minor
          Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

            Function testBroadcastDynamicShapeNextLayerBothUniformRaises has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def testBroadcastDynamicShapeNextLayerBothUniformRaises(
            Severity: Minor
            Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

              Function testBroadcastDynamicShapeNextLayerHalfRaggedRaises has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def testBroadcastDynamicShapeNextLayerHalfRaggedRaises(
              Severity: Minor
              Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

                Function testBroadcastDynamicShapeExtended has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def testBroadcastDynamicShapeExtended(self,
                Severity: Minor
                Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

                  Function testAdd has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def testAdd(self,
                  Severity: Minor
                  Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

                    Function testConstructorRaisesStatic has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def testConstructorRaisesStatic(self,
                    Severity: Minor
                    Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

                      Function testBroadcasterInitRaises has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def testBroadcasterInitRaises(self, source_shape, target_shape,
                      Severity: Minor
                      Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

                        Function testAdd has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def testAdd(self,
                                      lengths_a,
                                      lengths_b,
                                      new_impl,
                                      max_num_ops,
                        Severity: Minor
                        Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins 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

                        Function testBroadcastDynamicShapeNextLayerRaises has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def testBroadcastDynamicShapeNextLayerRaises(self, ac_0, bc_0, a_1, b_1,
                        Severity: Minor
                        Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 45 mins to fix

                          Function testBroadcastDynamicShapeStatic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def testBroadcastDynamicShapeStatic(self,
                          Severity: Minor
                          Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                            Function test_from_tensor_shape_raises has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              def test_from_tensor_shape_raises(self, shape, num_row_partitions, dtype,
                            Severity: Minor
                            Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                              Function testBroadcaster has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                def testBroadcaster(self,
                              Severity: Minor
                              Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                                Function testConstructorRaisesDynamic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  def testConstructorRaisesDynamic(self,
                                Severity: Minor
                                Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                                  Function test_constructor_raises has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                    def test_constructor_raises(self, row_partitions, static_inner_shape,
                                  Severity: Minor
                                  Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                                    Function testGetItemRaisesStatic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                      def testGetItemRaisesStatic(self,
                                    Severity: Minor
                                    Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                                      Function testIsUniformRaises has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                        def testIsUniformRaises(self, lengths, num_row_partitions, axis, error_type,
                                      Severity: Minor
                                      Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins to fix

                                        Function testAddShape has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          def testAddShape(self,
                                                           lengths_a,
                                                           lengths_b,
                                                           shape_e,
                                                           new_impl=False,
                                        Severity: Minor
                                        Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 35 mins 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

                                        Function testAddSelf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          def testAddSelf(self, lengths_a, new_impl, op_max, num_row_partitions_a=None):
                                            if context.executing_eagerly():
                                              return
                                            shape_a0 = DynamicRaggedShape.from_lengths(
                                                lengths_a, num_row_partitions=num_row_partitions_a)
                                        Severity: Minor
                                        Found in tensorflow/python/ops/ragged/dynamic_ragged_shape_test.py - About 25 mins 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

                                        There are no issues that match your filters.

                                        Category
                                        Status