tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/weak_tensor_np_array_ops_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File weak_tensor_np_array_ops_test.py has 1095 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2023 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/weak_tensor_np_array_ops_test.py - About 2 days 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 _all_types:
    Severity: Minor
    Found in tensorflow/python/ops/weak_tensor_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

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

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

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

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

      Function testMean has a Cognitive Complexity of 14 (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/weak_tensor_np_array_ops_test.py - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def testStd(self):
          def run_test(arr, res_dtype, *args, **kwargs):
            axis = kwargs.pop('axis', None)
            for fn1 in self.array_transforms:
              for fn2 in self.array_transforms:
      Severity: Minor
      Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py - About 1 hr 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 testCumProdAndSum has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def testCumProdAndSum(self):
      
          def run_test(arr, *args, **kwargs):
            for fn in self.array_transforms:
              arg = fn(arr)
      Severity: Minor
      Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py - About 1 hr 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/weak_tensor_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,
              np_array_ops.array,
              _get_weak_tensor,
      Severity: Minor
      Found in tensorflow/python/ops/weak_tensor_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/weak_tensor_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 match_expected_attrs has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def match_expected_attrs(
      Severity: Major
      Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py - About 50 mins to fix

        Avoid deeply nested control flow statements.
        Open

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

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

            def match_expected_attrs(
          Severity: Minor
          Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py - About 35 mins to fix

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

              def match_expected_attrs(
                  self,
                  actual,
                  expected,
                  expected_dtype,
            Severity: Minor
            Found in tensorflow/python/ops/weak_tensor_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 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/weak_tensor_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 testProd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testProd(self):
                def run_test(arr, *args, **kwargs):
                  for fn in self.array_transforms:
                    arg = fn(arr)
                    actual = np_array_ops.prod(arg, *args, **kwargs)
            Severity: Minor
            Found in tensorflow/python/ops/weak_tensor_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/weak_tensor_np_array_ops_test.py and 1 other location - About 2 days to fix
            tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 865..889

            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 testAsArray(self):
                for a, dtype in itertools.product(self.all_arrays, _all_types):
                  # Dtype specified.
                  self.match_expected_attrs(
                      np_array_ops.asarray(a, dtype=dtype),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 1 other location - About 1 day to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 304..329

            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 testAsAnyArray(self):
                for a, dtype in itertools.product(self.all_arrays, _all_types):
                  # Dtype specified.
                  self.match_expected_attrs(
                      np_array_ops.asanyarray(a, dtype=dtype),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 1 other location - About 1 day to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 277..302

            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 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/weak_tensor_np_array_ops_test.py and 1 other location - About 1 day to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 157..175

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

            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 testZerosLikeOnWeakInputs(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/weak_tensor_np_array_ops_test.py and 1 other location - About 1 day to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 199..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 139.

            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/weak_tensor_np_array_ops_test.py and 1 other location - About 5 hrs to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1039..1050

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

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

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

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

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

            Refactorings

            Further Reading

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

                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/weak_tensor_np_array_ops_test.py and 1 other location - About 5 hrs to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 1088..1099

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

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

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

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

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

            Refactorings

            Further Reading

            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/weak_tensor_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 267..275

            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

            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/weak_tensor_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 529..536

            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/weak_tensor_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 86..102

            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, *args, **kwargs):
                  for fn in self.array_transforms:
                    arg = fn(arr)
                    actual = np_array_ops.around(arg, *args, **kwargs)
                    expected = np.around(arg, *args, **kwargs)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 987..996

            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, *args, **kwargs):
                  for fn in self.array_transforms:
                    arg = fn(arr)
                    actual = np_array_ops.ravel(arg, *args, **kwargs)
                    expected = np.ravel(arg, *args, **kwargs)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 1068..1077

            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 kwargs.get('dtype', None) is None:
                      self.match_dtype_and_type(
                          actual,
                          _NP_to_TF_result_inferred_types[expected.dtype],
                          WeakTensor,
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 626..636

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

            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 kwargs.get('dtype', None) is None:
                      self.match_dtype_and_type(
                          actual,
                          _NP_to_TF_result_inferred_types[expected.dtype],
                          WeakTensor,
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 643..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 68.

            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/weak_tensor_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 72..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 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(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/weak_tensor_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/numpy_ops/np_array_ops_test.py on lines 637..640

            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

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

                      if dtype is None:
                        self.match_expected_attrs(
                            actual,
                            expected,
                            _NP_to_TF_result_inferred_types[expected.dtype],
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 879..891

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

            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 dtype is None:
                      self.match_expected_attrs(
                          actual,
                          expected,
                          _NP_to_TF_result_inferred_types[expected.dtype],
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 744..756

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

            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/weak_tensor_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 42..52

            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

            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/weak_tensor_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 63..65

            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_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/weak_tensor_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_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 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/weak_tensor_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_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

            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

                            self.match_expected_attrs(
                                np_array_ops.arange(start, stop, step, dtype=dtype),
                                np.arange(start, stop, step, dtype=dtype),
                                _NP_TO_TF[dtype],
                                tensor.Tensor,
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 417..422

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

            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_expected_attrs(
                                  np_array_ops.arange(start, stop, step, dtype=dtype),
                                  np.arange(start, stop, step, dtype=dtype),
                                  _NP_TO_TF[dtype],
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 436..440

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

            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

                      [[[0, 1], [2, 3]], [[4, 5], [6, 7]]],
                      0,
                      2,
                      [[[0, 4], [2, 6]], [[1, 5], [3, 7]]],
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 1225..1228

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

            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

                      [[[0, 1], [2, 3]], [[4, 5], [6, 7]]],
                      -3,
                      -1,
                      [[[0, 4], [2, 6]], [[1, 5], [3, 7]]],
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 1219..1222

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

            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

                run_test([[1 + 5j, 2 + 3j], [1 + 7j, 2 + 8j]], dtypes.float64)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 688..688

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

            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

                run_test([[1 + 5j, 2 + 3j], [1 + 7j, 2 + 8j]], dtypes.float64)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 1035..1035

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

            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/weak_tensor_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 1149..1151

            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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(),
                    res_dtype=None,
                    axis=(0, 2),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 816..819

            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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(),
                    res_dtype=None,
                    axis=(2, 0),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 807..810

            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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(),
                    axis=(0, 2),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 864..866

            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('all')
              np_math_ops.enable_numpy_methods_on_tensor()
              test.main()
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 1325..1329

            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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(),
                    axis=(2, 0),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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 855..857

            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 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/weak_tensor_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/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 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),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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/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 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/weak_tensor_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/numpy_ops/np_array_ops_test.py on lines 824..825
            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/weak_tensor_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/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 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),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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/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

            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),
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_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/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 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 4 locations. Consider refactoring.
            Open

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(), res_dtype=None, axis=(2, 0)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 3 other locations - About 55 mins to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 804..805
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 813..814
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 852..853

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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(), res_dtype=None, axis=(0, 2)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 3 other locations - About 55 mins to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 804..805
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 813..814
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 861..862

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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(), res_dtype=None, axis=(0, 2)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 3 other locations - About 55 mins to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 813..814
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 852..853
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 861..862

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

                run_test(
                    np.arange(8).reshape((2, 2, 2)).tolist(), res_dtype=None, axis=(2, 0)
            Severity: Major
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 3 other locations - About 55 mins to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 804..805
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 852..853
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 861..862

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

                      self.match_expected_attrs(
                          np_array_ops.full_like(arr, fill_value, dtype=dtype),
                          np.full_like(arr, fill_value, dtype=dtype),
                          _NP_TO_TF[dtype],
                          tensor.Tensor,
            Severity: Minor
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 1 other location - About 45 mins to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 382..386

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

            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.match_expected_attrs(
                            np_array_ops.arange(start, stop, dtype=dtype),
                            np.arange(start, stop, dtype=dtype),
                            _NP_TO_TF[dtype],
                            tensor.Tensor,
            Severity: Minor
            Found in tensorflow/python/ops/weak_tensor_np_array_ops_test.py and 1 other location - About 45 mins to fix
            tensorflow/python/ops/weak_tensor_np_array_ops_test.py on lines 248..252

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

            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/weak_tensor_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/numpy_ops/np_array_ops_test.py on lines 823..823
            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/weak_tensor_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/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

            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/weak_tensor_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/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 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/weak_tensor_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/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 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/weak_tensor_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/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 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/weak_tensor_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/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 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

            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/weak_tensor_np_array_ops_test.py and 1 other location - About 35 mins to fix
            tensorflow/python/ops/numpy_ops/np_array_ops_test.py on lines 60..61

            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