tensorflow/tensorflow

View on GitHub
tensorflow/python/framework/ops_test.py

Summary

Maintainability
F
1 wk
Test Coverage

File ops_test.py has 3024 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2015 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/framework/ops_test.py - About 1 wk to fix

    OperationTest has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class OperationTest(test_util.TensorFlowTestCase):
    
      def testTraceback(self):
        g = ops.Graph()
        op1 = ops.Operation.from_node_def(
    Severity: Minor
    Found in tensorflow/python/framework/ops_test.py - About 5 hrs to fix

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

      class TensorAndShapeTest(test_util.TensorFlowTestCase):
      
        def testShape(self):
          op = ops.Operation.from_node_def(
              ops._NodeDef("FloatOutput", "myop"), ops.Graph(), [], [dtypes.float32]
      Severity: Minor
      Found in tensorflow/python/framework/ops_test.py - About 3 hrs to fix

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

          def test_add_to_collection(self):
            g = ops.Graph()
            g.add_to_collection("key", 12)
            g.add_to_collection("other", "foo")
            g.add_to_collection("key", 34)
        Severity: Minor
        Found in tensorflow/python/framework/ops_test.py - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                      with g.device(pydev.merge_device(None)):
                        g.create_op("FloatOutput", [], [dtypes.float32])
          
          
          Severity: Major
          Found in tensorflow/python/framework/ops_test.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        with g.control_dependencies([a_4]):
                          # deps [a_3, a_4]
                          b_3_4 = _apply_op(g, "FloatOutput", [], [dtypes.float32])
                        # deps = [a_3]
                        b_3 = _apply_op(g, "FloatOutput", [], [dtypes.float32])
            Severity: Major
            Found in tensorflow/python/framework/ops_test.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          with g.control_dependencies([a_3]):
                            with g.control_dependencies([a_4]):
                              # deps [a_3, a_4]
                              b_3_4 = _apply_op(g, "FloatOutput", [], [dtypes.float32])
                            # deps = [a_3]
              Severity: Major
              Found in tensorflow/python/framework/ops_test.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            with g.device(""):
                              g.create_op("FloatOutput", [], [dtypes.float32])
                
                
                Severity: Major
                Found in tensorflow/python/framework/ops_test.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              with g3.as_default():
                                with ops.init_scope():
                                  # This op should be lifted into g3, because g3 is not building a
                                  # function.
                                  _ = constant_op.constant(1.0)
                  Severity: Major
                  Found in tensorflow/python/framework/ops_test.py - About 45 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status