tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/numpy_ops/np_array_ops_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File np_array_ops_test.py has 1110 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2020 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/numpy_ops/np_array_ops_test.py - About 2 days to fix

    ArrayMethodsTest has 39 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ArrayMethodsTest(test.TestCase):
    
      def setUp(self):
        super(ArrayMethodsTest, self).setUp()
        set_up_virtual_devices()
    Severity: Minor
    Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 5 hrs to fix

      Function testARange has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

        def testARange(self):
          int_values = np.arange(-3, 3).tolist()
          float_values = np.arange(-3.5, 3.5).tolist()
          all_values = int_values + float_values
          for dtype in self.all_types:
      Severity: Minor
      Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 4 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

      Function testEye has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

        def testEye(self):
          n_max = 3
          m_max = 3
      
          for n in range(1, n_max + 1):
      Severity: Minor
      Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.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

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

      class ArrayCreationTest(test.TestCase):
      
        def setUp(self):
          super(ArrayCreationTest, self).setUp()
          set_up_virtual_devices()
      Severity: Minor
      Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 2 hrs to fix

        Function testVar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def testVar(self):
        
            def run_test(arr, *args, **kwargs):
              axis = kwargs.pop('axis', None)
              for fn1 in self.array_transforms:
        Severity: Minor
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 55 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 testTranspose has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def testTranspose(self):
        
            def run_test(arr, axes=None):
              for fn1 in self.array_transforms:
                for fn2 in self.array_transforms:
        Severity: Minor
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 55 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 testMean has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def testMean(self):
        
            def run_test(arr, *args, **kwargs):
              axis = kwargs.pop('axis', None)
              for fn1 in self.array_transforms:
        Severity: Minor
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 55 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 testAMaxAMin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def testAMaxAMin(self):
        
            def run_test(arr, *args, **kwargs):
              axis = kwargs.pop('axis', None)
              for fn1 in self.array_transforms:
        Severity: Minor
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 55 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 _testReduce has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def _testReduce(self, math_fun, np_fun, name):
            axis_transforms = [
                lambda x: x,  # Identity,
                ops.convert_to_tensor,
                np.array,
        Severity: Minor
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 55 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 testStd has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def testStd(self):
        
            def run_test(arr, *args, **kwargs):
              axis = kwargs.pop('axis', None)
              for fn1 in self.array_transforms:
        Severity: Minor
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 55 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

        Avoid deeply nested control flow statements.
        Open

                    if not step:
                      with self.assertRaises(ValueError):
                        self.match(
                            np_array_ops.arange(start, stop, step),
                            np.arange(start, stop, step),
        Severity: Major
        Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 45 mins to fix

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

            def match(self, actual, expected, msg=None, almost=False, decimal=7):
          Severity: Minor
          Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 35 mins to fix

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

              def testConstantBinOp(self, a, b, b_type, expected_result, test_func):
            Severity: Minor
            Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py - About 35 mins to fix

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

                def match(self, actual, expected, msg=None, almost=False, decimal=7):
                  msg_ = 'Expected: {} Actual: {}'.format(expected, actual)
                  if msg:
                    msg = '{} {}'.format(msg_, msg)
                  else:
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_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 testSign has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def testSign(self):
                  state = np.random.RandomState(0)
                  test_types = [np.float16, np.float32, np.float64, np.int32, np.int64,
                                np.complex64, np.complex128]
                  test_shapes = [(), (1,), (2, 3, 4), (2, 3, 0, 4)]
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_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 testIx_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                def testIx_(self):
                  possible_arys = [[True, True], [True, False], [False, False],
                                   list(range(5)), np_array_ops.empty(0, dtype=np.int64)]
                  for r in range(len(possible_arys)):
                    for arys in itertools.combinations_with_replacement(possible_arys, r):
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_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

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

                def testFullLike(self):
                  # List of 2-tuples of fill value and shape.
                  data = [
                      (5, ()),
                      (5, (7,)),
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_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

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

                def testFull(self):
                  # List of 2-tuples of fill value and shape.
                  data = [
                      (5, ()),
                      (5, (7,)),
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_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

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

                def testSize(self):
              
                  def run_test(arr, axis=None):
                    onp_arr = np.array(arr)
                    self.assertEqual(np_array_ops.size(arr, axis), np.size(onp_arr, axis))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 days to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 956..983

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

              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 testReal(self):
              
                  def run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 669..686

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

              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 testImag(self):
              
                  def run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 910..926

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

              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 testEmptyLike(self):
                  for a in self.all_arrays:
                    actual = np_array_ops.empty_like(a)
                    expected = np.empty_like(a)
                    msg = 'array: {}'.format(a)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 115..128

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

              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 testEmpty(self):
                  for s in self.all_shapes:
                    actual = np_array_ops.empty(s)
                    expected = np.empty(s)
                    msg = 'shape: {}'.format(s)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 130..143

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

              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 testAsAnyArray(self):
                  for a, dtype in itertools.product(self.all_arrays, self.all_types):
                    self.match(
                        np_array_ops.asanyarray(a, dtype=dtype),
                        np.asanyarray(a, dtype=dtype))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 347..358

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

              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 testAsArray(self):
                  for a, dtype in itertools.product(self.all_arrays, self.all_types):
                    self.match(
                        np_array_ops.asarray(a, dtype=dtype), np.asarray(a, dtype=dtype))
              
              
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 360..371

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

              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

                def match(self, actual, expected, msg=None):
                  msg_ = 'Expected: {} Actual: {}'.format(expected, actual)
                  if msg:
                    msg = '{} {}'.format(msg_, msg)
                  else:
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 82..94

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

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

                def testZerosLike(self):
                  for a in self.all_arrays:
                    actual = np_array_ops.zeros_like(a)
                    expected = np.zeros_like(a)
                    msg = 'array: {}'.format(a)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 3 other locations - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 145..156
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 171..182
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 184..195

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

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

                def testOnesLike(self):
                  for a in self.all_arrays:
                    actual = np_array_ops.ones_like(a)
                    expected = np.ones_like(a)
                    msg = 'array: {}'.format(a)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 3 other locations - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 145..156
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 158..169
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 171..182

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

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

                def testZeros(self):
                  for s in self.all_shapes:
                    actual = np_array_ops.zeros(s)
                    expected = np.zeros(s)
                    msg = 'shape: {}'.format(s)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 3 other locations - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 158..169
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 171..182
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 184..195

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

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

                def testOnes(self):
                  for s in self.all_shapes:
                    actual = np_array_ops.ones(s)
                    expected = np.ones(s)
                    msg = 'shape: {}'.format(s)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 3 other locations - About 1 day to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 145..156
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 158..169
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 184..195

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

              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

                  def run_test(arr, *args, **kwargs):
                    axis = kwargs.pop('axis', None)
                    for fn1 in self.array_transforms:
                      for fn2 in self.array_transforms:
                        arr_arg = fn1(arr)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 721..729
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 749..757

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

              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

                  def run_test(arr, *args, **kwargs):
                    axis = kwargs.pop('axis', None)
                    for fn1 in self.array_transforms:
                      for fn2 in self.array_transforms:
                        arr_arg = fn1(arr)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 749..757
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 776..784

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

              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

                  def run_test(arr, *args, **kwargs):
                    axis = kwargs.pop('axis', None)
                    for fn1 in self.array_transforms:
                      for fn2 in self.array_transforms:
                        arr_arg = fn1(arr)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 721..729
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 776..784

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

              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 run_test(arr):
                    for fn in array_transforms:
                      arr = fn(arr)
                      self.match(
                          np_array_ops.diag(arr), np.diag(arr), msg='diag({})'.format(arr))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 481..492

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

              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 run_test(arr):
                    for fn in array_transforms:
                      arr = fn(arr)
                      self.match(
                          np_array_ops.diagflat(arr),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 443..452

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

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

                  array_transforms = [
                      lambda x: x,  # Identity,
                      ops.convert_to_tensor,
                      np.array,
                      lambda x: np.array(x, dtype=np.float32),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 3 other locations - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 432..440
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 279..287
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 308..316

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

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

                  array_transforms = [
                      lambda x: x,  # Identity,
                      ops.convert_to_tensor,
                      np.array,
                      lambda x: np.array(x, dtype=np.float32),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 3 other locations - About 6 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 470..478
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 279..287
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 308..316

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

              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

                  data = [
                      (5, ()),
                      (5, (7,)),
                      (5., (7,)),
                      ([5, 8], (2,)),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 222..230

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

              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 run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arr = fn(arr)
                      self.match(
                          np_array_ops.all(arr, *args, **kwargs),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 645..653

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

              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 run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
                      self.match(
                          np_array_ops.cumprod(arg, *args, **kwargs),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 570..578

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

              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 not almost:
                    if not actual.shape.rank:
                      self.assertEqual(actual.tolist(), expected.tolist())
                    else:
                      self.assertSequenceEqual(actual.tolist(), expected.tolist())
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 568..575

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

              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

                  source_array_data = [
                      1,
                      5.5,
                      7,
                      (),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 108..124

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

              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 run_test(arr, newshape, *args, **kwargs):
                    for fn1 in self.array_transforms:
                      for fn2 in self.array_transforms:
                        arr_arg = fn1(arr)
                        newshape_arg = fn2(newshape)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 3 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 930..937

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

              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 run_test(arr, repeats, *args, **kwargs):
                    for fn1 in self.array_transforms:
                      for fn2 in self.array_transforms:
                        arr_arg = fn1(arr)
                        repeats_arg = fn2(repeats)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 3 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 969..976

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

              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 not isinstance(start, float) and not isinstance(stop, float):
                              self.match(
                                  np_array_ops.arange(start, stop, step, dtype=dtype),
                                  np.arange(start, stop, step, dtype=dtype),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 3 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 415..418

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

              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 sys.version_info.major == 3:
                    # There is a bug of np.empty (and alike) in Python 3 causing a crash when
                    # the `shape` argument is an np_arrays.ndarray scalar (or tf.Tensor
                    # scalar).
                    def not_ndarray_scalar(s):
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 3 hrs to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 99..106

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

              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 not isinstance(start, float) and not isinstance(stop, float):
                                self.match(
                                    np_array_ops.arange(start, stop, step, dtype=dtype),
                                    np.arange(start, stop, step, dtype=dtype),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 3 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 425..428

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

              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

                  with ops.device('CPU:1'):
                    self.assertIn(
                        'CPU:1', np_array_ops.array(zeros_list, copy=True).backing_device)
                    self.assertIn(
                        'CPU:1', np_array_ops.array(np.array(0), copy=True).backing_device)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 637..640
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 611..614

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

              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

                  with ops.device('CPU:1'):
                    self.assertIn('CPU:1', np_array_ops.array(a, copy=True)
                                  .backing_device)
                    self.assertIn('CPU:1', np_array_ops.array(np.array(0), copy=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 341..345
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 611..614

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

              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.assertAllEqual(
                      np_array_ops.pad(t, paddings, 'symmetric'),
                      [[2, 1, 1, 2, 3, 3, 2], [2, 1, 1, 2, 3, 3, 2], [5, 4, 4, 5, 6, 6, 5],
                       [5, 4, 4, 5, 6, 6, 5]])
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1072..1075
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1077..1080

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

              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.assertAllEqual(
                      np_array_ops.pad(t, paddings, 'constant'),
                      [[0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 2, 3, 0, 0], [0, 0, 4, 5, 6, 0, 0],
                       [0, 0, 0, 0, 0, 0, 0]])
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1077..1080
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1082..1085

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

              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.assertAllEqual(
                      np_array_ops.pad(t, paddings, 'reflect'),
                      [[6, 5, 4, 5, 6, 5, 4], [3, 2, 1, 2, 3, 2, 1], [6, 5, 4, 5, 6, 5, 4],
                       [3, 2, 1, 2, 3, 2, 1]])
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1072..1075
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1082..1085

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

              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

              def set_up_virtual_devices():
                global _virtual_devices_ready
                if _virtual_devices_ready:
                  return
                physical_devices = config.list_physical_devices('CPU')
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 hrs to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 69..79

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

              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

                @StringParameters
                def testZerosLike(self, a, dtype, unused_a_as_bytes):
                  b = np_array_ops.zeros_like(a, dtype=dtype)
                  self.assertIsInstance(b.numpy(), bytes)
                  self.assertEqual(b.numpy(), b'')
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1318..1322

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

              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

                @StringParameters
                def testEmptyLike(self, a, dtype, unused_a_as_bytes):
                  b = np_array_ops.empty_like(a, dtype=dtype)
                  self.assertIsInstance(b.numpy(), bytes)
                  self.assertEqual(b.numpy(), b'')
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1312..1316

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

              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

                @StringParameters
                def testArray(self, a, dtype, a_as_bytes):
                  b = np_array_ops.array(a, dtype=dtype)
                  self.assertIsInstance(b.numpy(), bytes)
                  self.assertEqual(b.numpy(), a_as_bytes)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1306..1310

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

              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

                @StringParameters
                def testAsArray(self, a, dtype, a_as_bytes):
                  b = np_array_ops.asarray(a, dtype=dtype)
                  self.assertIsInstance(b.numpy(), bytes)
                  self.assertEqual(b.numpy(), a_as_bytes)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1300..1304

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

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

                  def run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
                      self.match(
                          np_array_ops.copy(arg, *args, **kwargs),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 4 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 805..810
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 893..898
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 954..959
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 265..269

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

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

                  def run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
                      self.match(
                          np_array_ops.prod(arg, *args, **kwargs),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 4 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 622..627
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 893..898
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 954..959
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 265..269

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

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

                  def run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
                      self.match(
                          np_array_ops.ravel(arg, *args, **kwargs),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 4 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 622..627
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 805..810
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 954..959
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 265..269

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

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

                  def run_test(arr, *args, **kwargs):
                    for fn in self.array_transforms:
                      arg = fn(arr)
                      self.match(
                          np_array_ops.around(arg, *args, **kwargs),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 4 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 622..627
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 805..810
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 893..898
              tensorflow/python/ops/numpy_ops/np_math_ops_test.py on lines 265..269

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

              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

                  self.shape_transforms = [
                      lambda x: x, lambda x: np.array(x, dtype=int),
                      lambda x: np_array_ops.array(x, dtype=int), tensor_shape.TensorShape
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 2 hrs to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 90..92

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

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

                def match_dtype(self, actual, expected, msg=None):
                  if msg:
                    msg = 'Dtype match failed for: {}. Expected: {} Actual: {}.'.format(
                        msg, expected.dtype, actual.dtype)
                  self.assertEqual(actual.dtype, expected.dtype, msg=msg)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 9 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 508..512
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 514..518
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1039..1043
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1045..1049
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1234..1238
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 70..74
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 76..80
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 533..537
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1180..1184

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

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

                def match_shape(self, actual, expected, msg=None):
                  if msg:
                    msg = 'Shape match failed for: {}. Expected: {} Actual: {}'.format(
                        msg, expected.shape, actual.shape)
                  self.assertEqual(actual.shape, expected.shape, msg=msg)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 9 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 514..518
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1039..1043
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1045..1049
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1234..1238
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1240..1244
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 70..74
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 76..80
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 533..537
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1180..1184

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

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

                def match_dtype(self, actual, expected, msg=None):
                  if msg:
                    msg = 'Dtype match failed for: {}. Expected: {} Actual: {}.'.format(
                        msg, expected.dtype, actual.dtype)
                  self.assertEqual(actual.dtype, expected.dtype, msg=msg)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 9 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 508..512
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 514..518
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1039..1043
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1234..1238
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1240..1244
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 70..74
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 76..80
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 533..537
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1180..1184

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

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

                def match_shape(self, actual, expected, msg=None):
                  if msg:
                    msg = 'Shape match failed for: {}. Expected: {} Actual: {}'.format(
                        msg, expected.shape, actual.shape)
                  self.assertEqual(actual.shape, expected.shape, msg=msg)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 9 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 508..512
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 514..518
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1045..1049
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1234..1238
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1240..1244
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 70..74
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 76..80
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 533..537
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1180..1184

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

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

                def match_dtype(self, actual, expected, msg=None):
                  if msg:
                    msg = 'Dtype match failed for: {}. Expected: {} Actual: {}.'.format(
                        msg, expected.dtype, actual.dtype)
                  self.assertEqual(actual.dtype, expected.dtype, msg=msg)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 9 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 508..512
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1039..1043
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1045..1049
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1234..1238
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1240..1244
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 70..74
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 76..80
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 533..537
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1180..1184

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

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

                def match_shape(self, actual, expected, msg=None):
                  if msg:
                    msg = 'Shape match failed for: {}. Expected: {} Actual: {}'.format(
                        msg, expected.shape, actual.shape)
                  self.assertEqual(actual.shape, expected.shape, msg=msg)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 9 other locations - About 2 hrs to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 508..512
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 514..518
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1039..1043
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1045..1049
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1240..1244
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 70..74
              tensorflow/python/ops/numpy_ops/np_logic_test.py on lines 76..80
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 533..537
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1180..1184

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

              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

                def testNdim(self):
                  self.assertAllEqual(0, np_array_ops.ndim(0.5))
                  self.assertAllEqual(1, np_array_ops.ndim([1, 2]))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1260..1262

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

              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 dtype in self.all_types:
                        self.match(
                            np_array_ops.full(shape, fill_value, dtype=dtype),
                            np.full(shape, fill_value, dtype=dtype))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 287..290

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

              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

              if __name__ == '__main__':
                ops.enable_eager_execution()
                ops.set_dtype_conversion_mode('legacy')
                np_math_ops.enable_numpy_methods_on_tensor()
                test.main()
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1265..1269

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

              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 dtype in self.all_types:
                        self.match(
                            np_array_ops.full_like(arr, fill_value, dtype=dtype),
                            np.full_like(arr, fill_value, dtype=dtype))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 260..263

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

              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

                  self.assertAllEqual([[[0, 4], [2, 6]], [[1, 5], [3, 7]]],
                                      np_array_ops.swapaxes(x, 0, 2))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1124..1125

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

              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

                  self.assertAllEqual([[[0, 4], [2, 6]], [[1, 5], [3, 7]]],
                                      np_array_ops.swapaxes(x, -3, -1))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 1122..1123

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

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 768..769
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

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

                  run_test(
                      np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2), keepdims=True)
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 55 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 711..712
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 714..715
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 740..741
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 743..744
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 771..772
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 796..797
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 799..800
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 821..822
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 824..825
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 725..726
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 728..729
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 767..769
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 773..775
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 903..905
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 909..911

              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

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

                      for k in range(-n, n + 1):
                        self.match(
                            np_array_ops.eye(n, k=k, dtype=dtype),
                            np.eye(n, k=k, dtype=dtype))
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 50 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 222..224

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

              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

                          self.match(
                              np_array_ops.eye(n, k=k, dtype=dtype),
                              np.eye(n, k=k, dtype=dtype))
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 50 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 214..217

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

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(0, 2))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 823..823
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

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

                  run_test(np.arange(8).reshape((2, 2, 2)).tolist(), axis=(2, 0))
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 15 other locations - About 40 mins to fix
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 710..710
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 713..713
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 739..739
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 742..742
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 767..767
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 770..770
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 795..795
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 798..798
              tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 820..820
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 724..724
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 727..727
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 766..766
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 772..772
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 902..902
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 908..908

              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.match(
                          np_array_ops.arange(start, dtype=dtype),
                          np.arange(start, dtype=dtype),
              Severity: Major
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 2 other locations - About 40 mins to fix
              tensorflow/python/ops/weak_tensor_np_math_ops_test.py on lines 136..138
              tensorflow/python/ops/weak_tensor_np_math_ops_test.py on lines 141..143

              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

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

                  python_shapes = [
                      0, 1, 2, (), (1,), (2,), (1, 2, 3), [], [1], [2], [1, 2, 3]
              Severity: Minor
              Found in tensorflow/python/ops/numpy_ops/np_array_ops_test.py and 1 other location - About 35 mins to fix
              tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 87..88

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

              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