tensorflow/tensorflow

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

Summary

Maintainability
F
3 wks
Test Coverage

File ragged_tensor_test.py has 1941 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    RaggedTensorTest has 89 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class RaggedTensorTest(test_util.TensorFlowTestCase, parameterized.TestCase):
      longMessage = True  # Property in unittest.Testcase. pylint: disable=invalid-name
    
      #=============================================================================
      # RaggedTensor class docstring examples
    Severity: Major
    Found in tensorflow/python/ops/ragged/ragged_tensor_test.py - About 1 day to fix

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

        def testFactoryTypePreference(self, descr, test, factory, values,
      Severity: Minor
      Found in tensorflow/python/ops/ragged/ragged_tensor_test.py - About 45 mins to fix

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

          def testRaggedTensorSetShape(self, rt, rt_ragged_rank, shape):
            rt1 = ragged_factory_ops.constant(rt, ragged_rank=rt_ragged_rank)
            rt1._set_shape(shape)
            rt1.shape.assert_is_compatible_with(shape)
            if shape is not None:
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_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 testUnbatchVariantInDataset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def testUnbatchVariantInDataset(self):
            rt = ragged_factory_ops.constant([[1, 2, 3], [4, 5], [], [6, 7, 8, 9]])
            ds = dataset_ops.Dataset.from_tensor_slices(rt)
            if context.executing_eagerly():
              for i, value in enumerate(ds):
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_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 testRaggedTensorSetShapeWithPlaceholders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def testRaggedTensorSetShapeWithPlaceholders(self, rt, rt_ragged_rank, shape):
            rt2 = nest.map_structure(
                lambda x: array_ops.placeholder_with_default(x, None),
                ragged_factory_ops.constant(rt, ragged_rank=rt_ragged_rank),
                expand_composites=True)
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_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

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

          @parameterized.parameters([
              ([[[1, 2], [3, 4, 5]], [[6]]], 2, None),
              ([[[1, 2], [3, 4, 5]], [[6]]], 2, [None, None, None]),
              ([[[1, 2], [3, 4, 5]], [[6]]], 2, [2, None, None]),
              ([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9]]], 1, None),
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 days to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1950..1959

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

        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

          @parameterized.parameters([
              ([[[1, 2], [3, 4, 5]], [[6]]], 2, None),
              ([[[1, 2], [3, 4, 5]], [[6]]], 2, [None, None, None]),
              ([[[1, 2], [3, 4, 5]], [[6]]], 2, [2, None, None]),
              ([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9]]], 1, None),
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 days to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1971..1980

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

        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 testFromRowLimits(self):
            values = constant_op.constant(['a', 'b', 'c', 'd', 'e', 'f', 'g'])
            row_limits = constant_op.constant([2, 2, 5, 6, 7], dtypes.int64)
        
            rt = RaggedTensor.from_row_limits(values, row_limits, validate=False)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 326..343

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

        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 testFromRowStarts(self):
            values = constant_op.constant(['a', 'b', 'c', 'd', 'e', 'f', 'g'])
            row_starts = constant_op.constant([0, 2, 2, 5, 6], dtypes.int64)
        
            rt = RaggedTensor.from_row_starts(values, row_starts, validate=False)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 345..362

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

        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 testRaggedVariantGradientsEmptyRowsBatched(self):
        
            def func(x):
              rt1 = RaggedTensor.from_row_splits(
                  values=x, row_splits=[0, 2, 2, 4, 7, 7, 8])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1668..1679

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

        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 testRaggedVariantGradientsEmptyRows(self):
        
            def func(x):
              rt1 = RaggedTensor.from_row_splits(
                  values=x, row_splits=[0, 2, 2, 4, 7, 7, 8])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1702..1713

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

        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 testRaggedVariantGradients(self):
        
            def func(x):
              rt1 = RaggedTensor.from_row_splits(values=x, row_splits=[0, 4, 7, 8])
              rt2 = rt1 * [[10], [100], [1000]]
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1690..1700

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

        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 testRaggedVariantGradientsBatched(self):
        
            def func(x):
              rt1 = RaggedTensor.from_row_splits(values=x, row_splits=[0, 4, 7, 8])
              rt2 = rt1 * [[10], [100], [1000]]
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1656..1666

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

        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 shape is not None:
              self.assertIsNot(rt2.shape.rank, None)
              for a, b in zip(rt2.shape, shape):
                if b is not None:
                  self.assertEqual(a, b)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1965..1969

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 60.

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

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

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

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

        Refactorings

        Further Reading

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

            if shape is not None:
              self.assertIsNot(rt1.shape.rank, None)
              for a, b in zip(rt1.shape, shape):
                if b is not None:
                  self.assertEqual(a, b)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1989..1993

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

            def func(x):
        
              def transform_row(row):
                return math_ops.sqrt(
                    math_ops.reduce_mean(math_ops.square(row * x), keepdims=True))
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1803..1809
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1817..1823

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

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

            def func(x):
        
              def transform_row(row):
                return math_ops.sqrt(
                    math_ops.reduce_mean(math_ops.square(row * x), keepdims=True))
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1803..1809
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1831..1837

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

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

            def func(x):
        
              def transform_row(row):
                return math_ops.sqrt(
                    math_ops.reduce_mean(math_ops.square(row * x), keepdims=True))
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1817..1823
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1831..1837

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

        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

            expected_rt = ragged_factory_ops.constant([[[0], [1]], [[2], [3]], [[4],
                                                                                [5]],
                                                       [[6], [7]], [[8], [9]]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1429..1431

        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

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

            expected_rt = ragged_factory_ops.constant([[[0], [1]], [[2], [3]], [[4],
                                                                                [5]],
                                                       [[6], [7]], [[8], [9]]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1446..1448

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

            def func(x):
              rt1 = RaggedTensor.from_row_splits(values=x, row_splits=[0, 4, 7, 8])
              return map_fn.map_fn(
                  math_ops.reduce_max,
                  rt1,
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1868..1874

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

            def func(x):
              rt1 = RaggedTensor.from_row_splits(
                  values=x, row_splits=[0, 0, 0, 0])
              return map_fn.map_fn(
                  math_ops.reduce_max,
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1843..1848

        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

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

            rt = ragged_factory_ops.constant(
                [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]],
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1420..1421

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

        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

            rt = ragged_factory_ops.constant(
                [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]],
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1436..1437

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

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

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

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

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

        Refactorings

        Further Reading

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

          def assertAllTensorsEqual(self, list1, list2):
            self.assertLen(list1, len(list2))
            for (t1, t2) in zip(list1, list2):
              self.assertAllEqual(t1, t2)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/framework/sparse_tensor_test.py on lines 234..237
        tensorflow/tools/proto_splitter/split_graph_def_test.py on lines 53..56

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

        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

          @parameterized.named_parameters([
              {
                  'testcase_name': 'RaggedRank0',
                  'rt_spec': RaggedTensorSpec(ragged_rank=0),
                  'rt': [1.0, 2.0, 3.0],
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/nn_test.py on lines 1205..1210

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

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

              self.assertAllEqual(
                  rt.values,
                  [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11], [12, 13]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 7 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/sparse_ops/sparse_concat_op_test.py on lines 206..208
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 93..95
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 98..100
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 112..114
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 158..160
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 729..731
        tensorflow/python/ops/ragged/ragged_to_sparse_op_test.py on lines 45..46

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

              self.assertAllEqual(
                  rt.flat_values,
                  [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11], [12, 13]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 7 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/sparse_ops/sparse_concat_op_test.py on lines 206..208
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 93..95
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 98..100
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 112..114
        tensorflow/python/kernel_tests/sparse_ops/sparse_slice_op_test.py on lines 158..160
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 717..719
        tensorflow/python/ops/ragged/ragged_to_sparse_op_test.py on lines 45..46

        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

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

            nested_value_rowids = [
                constant_op.constant([0, 0, 1, 3, 3, 3], dtypes.int64),
                constant_op.constant([0, 0, 2, 2, 2, 3, 4], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 505..507

        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

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

            nested_value_rowids = [
                constant_op.constant([0, 0, 1, 3, 3, 3], dtypes.int64),
                constant_op.constant([0, 0, 2, 2, 2, 3, 4], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 537..539

        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

            b = RaggedTensor.from_row_splits(
                array_ops.placeholder(dtypes.int32, shape=[None], name='b.values'),
                array_ops.placeholder(dtypes.int64, name='b.row_splits'))
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 914..916

        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

            a = RaggedTensor.from_row_splits(
                array_ops.placeholder(dtypes.int32, shape=[None], name='a.values'),
                array_ops.placeholder(dtypes.int64, name='a.row_splits'))
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 917..919

        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

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

            nested_value_rowids = [
                constant_op.constant([0, 0, 1, 3, 3], dtypes.int64),
                constant_op.constant([0, 0, 2, 2, 2, 3, 4], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 466..468

        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

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

            nested_value_rowids = [
                constant_op.constant([0, 0, 1, 3, 3], dtypes.int64),
                constant_op.constant([0, 0, 2, 2, 2, 3, 4], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 744..746

        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

              {
                  'descr': 'from_row_lengths',
                  'factory': RaggedTensor.from_row_lengths,
                  'test': RaggedTensor.row_lengths,
                  'values': {
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1000..1009

        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

              {
                  'descr': 'from_row_starts',
                  'factory': RaggedTensor.from_row_starts,
                  'test': RaggedTensor.row_starts,
                  'values': {
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 988..997

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

            self._testGradient(
                functools.partial(func, i=4), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 0., 0., 0., 0., 0., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=2), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 30., 30., 0., 0., 0., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=1), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 0., 0., 100., 100., 100., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=0), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [10., 10., 0., 0., 0., 0., 0., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            nested_row_splits = [
                constant_op.constant([0, 2, 3, 3, 5], dtypes.int64),
                constant_op.constant([0, 2, 2, 5, 6, 7], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 583..585
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 740..742

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=3), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 0., 0., 40., 40., 40., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            nested_row_splits = [
                constant_op.constant([0, 2, 3, 3, 5], dtypes.int64),
                constant_op.constant([0, 2, 2, 5, 6, 7], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 559..561
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 583..585

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=2), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 0., 0., 0., 0., 0., 1000.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            nested_row_splits = [
                constant_op.constant([0, 2, 3, 3, 5], dtypes.int64),
                constant_op.constant([0, 2, 2, 5, 6, 7], dtypes.int64)
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 559..561
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 740..742

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=0), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [10., 10., 10., 10., 0., 0., 0., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=5), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 0., 0., 0., 0., 0., 60.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1759..1761
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testGradient(
                functools.partial(func, i=1), [3.0, 1.0, 4.0, 1.0, 1.0, 0.0, 2.0, 1.0],
                [0., 0., 0., 0., 0., 0., 0., 0.])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 8 other locations - About 1 hr to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1736..1738
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1739..1741
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1742..1744
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1756..1758
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1762..1764
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1765..1767
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1768..1770
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1771..1773

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

                  'ragged_constant': [[[[1, 2], [3, 4]]],
                                      [[[0, 0], [0, 0]], [[5, 6], [7, 8]]], []],
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/ops/ragged/ragged_from_tensor_op_test.py on lines 243..246

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

              {
                  'testcase_name': 'RaggedRank2',
                  'rt_spec': RaggedTensorSpec(shape=[2, None, None]),
                  'rt': [[[1.0, 2.0], [3.0]], [[], [4.0]]]
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 45 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 2229..2232

        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

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

              {
                  'testcase_name': 'RaggedRank2',
                  'rt_spec': RaggedTensorSpec(shape=[2, None, None]),
                  'rt': [[[1.0, 2.0], [3.0]], [[], [4.0]]]
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 45 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 2248..2251

        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

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

            self.assertAllEqual(
                rt, [[[b'a', b'b'], []], [[b'c', b'd', b'e']], [], [[b'f'], [b'g']]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 4 other locations - About 40 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 484..485
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 500..501
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 578..579
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 752..753

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

            self.assertAllEqual(
                rt, [[[b'a', b'b'], []], [[b'c', b'd', b'e']], [], [[b'f'], [b'g']]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 4 other locations - About 40 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 484..485
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 500..501
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 605..606
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 752..753

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

            self.assertAllEqual(
                rt, [[[b'a', b'b'], []], [[b'c', b'd', b'e']], [], [[b'f'], [b'g']]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 4 other locations - About 40 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 484..485
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 578..579
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 605..606
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 752..753

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

            self.assertAllEqual(
                rt, [[[b'a', b'b'], []], [[b'c', b'd', b'e']], [], [[b'f'], [b'g']]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 4 other locations - About 40 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 500..501
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 578..579
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 605..606
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 752..753

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

              self.assertAllEqual(
                  rt, [[[b'a', b'b'], []], [[b'c', b'd', b'e']], [], [[b'f'], [b'g']]])
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 4 other locations - About 40 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 484..485
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 500..501
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 578..579
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 605..606

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

            values = [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9], [10, 11], [12, 13]]
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 6 other locations - About 40 mins to fix
        tensorflow/python/kernel_tests/logging_ops_test.py on lines 220..220
        tensorflow/python/kernel_tests/logging_ops_test.py on lines 242..242
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 678..678
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 1005..1005
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 1033..1033
        tensorflow/python/kernel_tests/nn_ops/embedding_ops_test.py on lines 1042..1042

        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

              def wrap_arg(v):
                return array_ops.placeholder_with_default(
                    constant_op.constant(v, dtype=dtypes.int64),
                    tensor_shape.TensorShape(None))
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 40 mins to fix
        tensorflow/python/ops/ragged/row_partition_test.py on lines 497..500

        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

              self.assertEqual(result['rt2'].to_list(), [[[], [1, 2]], [[3]]])
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 883..883

        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

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

                  'ragged_constant': [[[1], [2]], [[3], [4]], [[5], [6]], [[7], [8]]],
        Severity: Major
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 3 other locations - About 35 mins to fix
        tensorflow/python/ops/ragged/ragged_from_tensor_op_test.py on lines 113..113
        tensorflow/python/ops/ragged/ragged_from_tensor_op_test.py on lines 114..114
        tensorflow/python/ops/bincount_ops_test.py on lines 435..435

        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

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

              self.assertEqual(result['rt2'].to_list(), [[[], [1, 2]], [[3]]])
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 907..907

        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

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

            unbatched = [constant_op.constant(x) for x in [[0], [1], [2], [3]]]
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1540..1540

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

        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

            unbatched = [constant_op.constant(x) for x in [[0], [1], [2], [3]]]
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 1501..1501

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

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

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

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

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

        Refactorings

        Further Reading

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

            self.assertAllEqual(rt, [[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]])
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 96..97

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

        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

            inner_rt = RaggedTensor.from_row_splits(
                values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8])
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 73..74

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

        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

            rt = RaggedTensor.from_row_splits(
                values=[3, 1, 4, 1, 5, 9, 2, 6], row_splits=[0, 4, 4, 7, 8, 8])
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 91..92

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 32.

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

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

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

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

        Refactorings

        Further Reading

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

            self.assertAllEqual(outer_rt,
                                [[[3, 1, 4, 1], [], [5, 9, 2]], [], [[6], []]])
        Severity: Minor
        Found in tensorflow/python/ops/ragged/ragged_tensor_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/ragged/ragged_tensor_test.py on lines 104..104

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

        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