tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File parsing_ops_test.py has 2197 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Function _test has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

      def _test(self,
                kwargs,
                expected_context_values=None,
                expected_feat_list_values=None,
                expected_length_values=None,
    Severity: Minor
    Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    ParseExampleTest has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ParseExampleTest(test.TestCase):
    
      def _test(self, kwargs, expected_values=None, expected_err=None):
        if expected_err:
          if not context.executing_eagerly():
    Severity: Minor
    Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 2 hrs to fix

      Function _testBoth has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

        def _testBoth(self,
                      kwargs,
                      expected_context_values=None,
                      expected_feat_list_values=None,
                      expected_err=None):
      Severity: Minor
      Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function _test has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        def _test(self, kwargs, expected_values=None, expected_err=None):
          if expected_err:
            if not context.executing_eagerly():
              with self.assertRaisesWithPredicateMatch(expected_err[0],
                                                       expected_err[1]):
      Severity: Minor
      Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function _test has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def _test(self, kwargs, expected_values=None, expected_err=None):
          if expected_err:
            with self.assertRaisesWithPredicateMatch(expected_err[0],
                                                     expected_err[1]):
              self.evaluate(parsing_ops.parse_single_example(**kwargs))
      Severity: Minor
      Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

        def _ordinalize(self, words, fixed_length=None):
          outputs = []
          if fixed_length is None:
            fixed_length = len(words[0])
      
      
      Severity: Minor
      Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

        def _test(self,
      Severity: Minor
      Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py - About 45 mins to fix

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

            original = [
                example(
                    features=features({
                        # rt = [[3], [4, 5, 6]]
                        "rt_values": float_feature([3, 4, 5, 6]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 days to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 957..996

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 254.

        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

            test_features = {
                "rt1":
                    parsing_ops.RaggedFeature(
                        value_key="rt_values",
                        partitions=[parsing_ops.RaggedFeature.RowSplits("rt_splits")],
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1001..1039

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

        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

                elif isinstance(f, parsing_ops.VarLenFeature) and batch:
                  if context.executing_eagerly():
                    context_out[k].indices.shape.assert_is_compatible_with([None, 2])
                    context_out[k].values.shape.assert_is_compatible_with([None])
                    context_out[k].dense_shape.shape.assert_is_compatible_with([2])
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 107..115
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1506..1514

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

        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

              elif isinstance(f, parsing_ops.VarLenFeature):
                if context.executing_eagerly():
                  out[k].indices.shape.assert_is_compatible_with([None, 2])
                  out[k].values.shape.assert_is_compatible_with([None])
                  out[k].dense_shape.shape.assert_is_compatible_with([2])
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1497..1505
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1506..1514

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

        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

                elif isinstance(f, parsing_ops.VarLenFeature) and not batch:
                  if context.executing_eagerly():
                    context_out[k].indices.shape.assert_is_compatible_with([None, 1])
                    context_out[k].values.shape.assert_is_compatible_with([None])
                    context_out[k].dense_shape.shape.assert_is_compatible_with([1])
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 107..115
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1497..1505

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

        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

            original = [
                example(
                    features=features({
                        "val": float_feature([3, 4]),
                        "idx0": int64_feature([5, 10]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 338..356
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 364..382

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

        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_output = {
                aname:
                    np.array(
                        [
                            [0, 0, 0, 0],
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 776..793

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

        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

            original = [
                # rt shape: [(batch), 2, None, None]
                example(
                    features=features({
                        # rt = [[[[1]], [[2, 3], [4]]], [[], [[5, 6, 7]]]]
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1076..1092

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 129.

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

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

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

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

        Refactorings

        Further Reading

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

            original = [
                example(features=features({
                    cname: int64_feature([2]),
                })),
                example(
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 7 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 699..713
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 753..770
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 705..719

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

        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

            original = [
                (example(features=features({
                    aname: float_feature([10, 10]),
                })),
                 example(
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 7 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 427..440
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 461..474

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

        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

            original = [
                example(
                    features=features({
                        "val": float_feature([3, 4]),
                        "idx": int64_feature([5, 10])
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 7 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 259..275
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 278..294

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

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

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

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

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

        Refactorings

        Further Reading

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

            for i in range(1, batch_size):
              col = 1
              if np.random.rand() < 0.25:
                # w.p. 25%, drop out the second entry
                expected_str[i][col] = b"default"
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 648..658

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

        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

            original = sequence_example(
                feature_lists=feature_lists({
                    "a":
                        feature_list([int64_feature([3, 4]),
                                      int64_feature([1, 0])]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1741..1757

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 99.

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

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

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

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

        Refactorings

        Further Reading

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

            original = sequence_example(
                feature_lists=feature_lists({
                    "a":
                        feature_list([int64_feature([3, 4]),
                                      int64_feature([1, 0])]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1684..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 99.

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

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

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

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

        Refactorings

        Further Reading

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

            original = [
                example(features=features({"rt_c": float_feature([3, 4])})),
                example(
                    features=features({
                        "rt_c": float_feature([]),  # empty float list
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 5 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 217..229
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 232..244
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 242..255

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

        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

            original = [
                example(features=features({"st_c": float_feature([3, 4])})),
                example(
                    features=features({
                        "st_c": float_feature([]),  # empty float list
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 5 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 217..229
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 232..244
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 964..977

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

        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._test(
                {
                    "example_names": example_names,
                    "serialized": ops.convert_to_tensor(serialized),
                    "features": {
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 5 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 818..833

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

        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

                {
                    "example_names": example_names,
                    "serialized": ops.convert_to_tensor(serialized),
                    "features": {
                        aname:
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 5 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 940..956

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

        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

            test_features = {
                "st_a":
                    parsing_ops.VarLenFeature(dtypes.float32),
                "sp":
                    parsing_ops.SparseFeature(["idx"], "val", dtypes.string, [13]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 5 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 955..972

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

        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

            input_features = {
                "st_a":
                    parsing_ops.VarLenFeature(dtypes.int64),
                "a":
                    parsing_ops.FixedLenFeature((1, 3),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 5 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 154..168
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 161..175

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 88.

        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

            original = [
                example(
                    features=features({
                        "c": float_feature([3, 4]),
                        "val": bytes_feature([b"a", b"b"]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 545..553
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 593..601

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

        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

                    "features": {
                        aname:
                            parsing_ops.FixedLenSequenceFeature((2, 1),
                                                                dtype=dtypes.float32,
                                                                allow_missing=True,
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 826..841

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 83.

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

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

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

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

        Refactorings

        Further Reading

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

          def testDecodeRawExtendedInputBytesBigEndian(self):
            # Input bytes properly padded internally to at least dtype size.
            input_bytes = [b"\x01\x23"]
            observed = self._decode_v2(
                input_bytes, fixed_length=8, dtype=dtypes.int32, little_endian=False
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2391..2400

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 82.

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

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

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

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

        Refactorings

        Further Reading

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

          def testDecodeRawExtendedInputBytesLittleEndian(self):
            # Input bytes properly padded internally to at least dtype size.
            input_bytes = ["\x01\x23"]
            observed = self._decode_v2(
                input_bytes, fixed_length=8, dtype=dtypes.int32, little_endian=True
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2402..2411

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 82.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_rt = ragged_factory_ops.constant(
                [[[[[1]], [[2, 3], [4]]], [[], [[5, 6, 7]]]],
                 [[[[1, 2, 3], [4]], [[5], [6], [7, 8]]]]],
                dtype=dtypes.float32,
                row_splits_dtype=dtypes.int64)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1111..1115

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

        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

                    "features": {
                        "st_a":
                            parsing_ops.VarLenFeature(dtypes.int64),
                        "sp":
                            parsing_ops.SparseFeature("idx", "val", dtypes.string, 13),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 572..585
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 639..653

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 75.

        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

            expected_st_c = (  # indices, values, shape
                np.array([[0, 0], [0, 1], [3, 0], [3, 1], [3, 2]], dtype=np.int64),
                np.array([3.0, 4.0, 1.0, 2.0, -1.0], dtype=np.float32),
                np.array([4, 3], dtype=np.int64))  # batch == 2, max_elems = 3
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 311..314

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

        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

            expected_sp = (  # indices, values, shape
                np.array([[0, 5], [0, 10], [3, 0], [3, 3], [3, 9]], dtype=np.int64),
                np.array([3.0, 4.0, 1.0, -1.0, 2.0], dtype=np.float32),
                np.array([4, 13], dtype=np.int64))  # batch == 4, max_elems = 13
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 261..264

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

        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

            original = [
                example(
                    features=features({
                        "val1": float_feature([3, 4]),
                        "val2": float_feature([5, 6]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 296..304
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 323..331

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

        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_output = {
                "a":
                    np.array(
                        [[1, 1], [3, -3], [3, -3]],
                        dtype=np.float32).reshape(3, 1, 2, 1),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 511..519

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

        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

            original = [
                example(
                    features=features({
                        "val": bytes_feature([b"a", b"b"]),
                        "idx": int64_feature([0, 3])
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 602..608
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 660..666

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 68.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_output = {
                "st_a": expected_st_a,
                "sp": expected_sp,
                "a": np.array(2 * [[a_default]]),
                "b": np.array(2 * [b_default]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 561..567

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 68.

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

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

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

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

        Refactorings

        Further Reading

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

            original = [
                example(features=features({
                    "a": float_feature([1, 1]),
                })),
                example(features=features({
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 497..505
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 536..544

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

        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

                    "features": {
                        sparse_name:
                            parsing_ops.VarLenFeature(dtypes.int64),
                        a_name:
                            parsing_ops.FixedLenFeature(
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 136..147
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 145..156

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

        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

            original = [
                example(
                    features=features({
                        aname: float_feature([1, 1]),
                        bname: bytes_feature([b"b0_str"]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 386..392
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 413..419

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

        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

            expected_st_a = (
                np.array([[0, 0], [0, 1], [2, 0]], dtype=np.int64),  # indices
                np.array([3.0, 4.0, 5.0], dtype=np.float32),  # values
                np.array([3, 2], dtype=np.int64))  # shape: num_time = 3, max_feat = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1706..1709
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1763..1766

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 65.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (
                np.array([[0, 0], [0, 1], [1, 0]], dtype=np.int64),  # indices
                np.array([3.0, 4.0, 5.0], dtype=np.float32),  # values
                np.array([3, 2], dtype=np.int64))  # shape: num_time = 3, max_feat = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1763..1766
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1811..1814

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 65.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (
                np.array([[0, 0], [0, 1], [1, 0]], dtype=np.int64),  # indices
                np.array([3.0, 4.0, 5.0], dtype=np.float32),  # values
                np.array([3, 2], dtype=np.int64))  # shape: num_time = 3, max_feat = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1706..1709
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1811..1814

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 65.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_output = {
                aname:
                    np.array([[1, 1], [-1, -1]], dtype=np.float32).reshape(2, 1, 2, 1),
                bname:
                    np.array(["b0_str", "b1"], dtype=bytes).reshape(2, 1, 1, 1, 1),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 398..406
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 448..456
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 450..454

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

        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

            expected_output = {
                aname:
                    np.array([[1, 1], [-1, -1]], dtype=np.float32).reshape(2, 1, 2, 1),
                bname:
                    np.array(["b0_str", ""], dtype=bytes).reshape(2, 1, 1, 1, 1),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 398..406
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 448..456
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 504..508

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

        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

            expected_sp = (  # indices, values, shape
                np.array([[0, 0], [0, 3], [1, 7]],
                         dtype=np.int64), np.array(["a", "b", "c"], dtype="|S"),
                np.array([2, 13], dtype=np.int64))  # batch == 4, max_elems = 13
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1711..1714
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1768..1771

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

        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

            expected_st_b = (
                np.array([[0, 0], [3, 0], [3, 1]], dtype=np.int64),  # indices
                np.array(["a", "b", "c"], dtype="|S"),  # values
                np.array([4, 2], dtype=np.int64))  # shape: num_time = 4, max_feat = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 597..600
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1711..1714

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

        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

            expected_st_b = (
                np.array([[0, 0], [3, 0], [3, 1]], dtype=np.int64),  # indices
                np.array(["a", "b", "c"], dtype="|S"),  # values
                np.array([4, 2], dtype=np.int64))  # shape: num_time = 4, max_feat = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 597..600
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1768..1771

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

        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

            original = example(
                features=features({
                    "c": float_feature([3, 4]),
                    "d": float_feature([0.0, 1.0]),
                    "val": bytes_feature([b"a", b"b"]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 916..921

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

        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._test(
                {
                    "serialized": ops.convert_to_tensor(serialized),
                    "features": {
                        aname:
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 459..470

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

        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._test(
                {
                    "serialized": ops.convert_to_tensor(serialized),
                    "features": {
                        aname:
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 513..524

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

        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

            expected_sp1 = (  # indices, values, shape
                np.array([[0, 5], [0, 10]],
                         dtype=np.int64), np.array([3.0, 4.0], dtype=np.float32),
                np.array([2, 13], dtype=np.int64))  # batch == 2, max_elems = 13
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 352..355

        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

          def testDecodeRawV2FallbackEqualLength(self):
            words = ["string1", "string2"]
        
            observed = self._decode_v2(words)
            expected = self._ordinalize(words)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2343..2350

        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

            expected_sp2 = (  # indices, values, shape
                np.array([[0, 5], [0, 10]],
                         dtype=np.int64), np.array([5.0, 6.0], dtype=np.float32),
                np.array([2, 7], dtype=np.int64))  # batch == 2, max_elems = 13
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 347..350

        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

          def testDecodeRawV1EqualLength(self):
            words = ["string1", "string2"]
        
            observed = self._decode_v1(words)
            expected = self._ordinalize(words)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2352..2359

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 60.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_output = {
                sparse_name: expected_st_a,
                a_name: np.array(2 * [[a_default]]),
                b_name: np.array(2 * [b_default]),
                c_name: np.array(2 * [c_default]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 128..132

        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

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

            test_features = {
                "rt1":
                    parsing_ops.RaggedFeature(
                        value_key="rt_values",
                        partitions=[
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1097..1107
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2201..2211

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

        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

            context_features = {
                "a":
                    parsing_ops.RaggedFeature(
                        value_key="a_values",
                        partitions=[
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1097..1107
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1163..1173

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

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (
                np.array([[0], [1]], dtype=np.int64),  # indices
                np.array([3.0, 4.0], dtype=np.float32),  # values
                np.array([2], dtype=np.int64))  # shape: max_values = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 926..932
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1256..1259
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1586..1589

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 57.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (
                np.array([[0], [1]], dtype=np.int64),  # indices
                np.array([3.0, 4.0], dtype=np.float32),  # values
                np.array([2], dtype=np.int64))  # shape: num_features = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 926..932
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1256..1259
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1382..1385

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 57.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (
                np.array([[0], [1]], dtype=np.int64),  # indices
                np.array([3.0, 4.0], dtype=np.float32),  # values
                np.array([2], dtype=np.int64))  # shape: max_values = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 926..932
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1382..1385
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1586..1589

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 57.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_output_custom_padding[aname] = np.array(
                [
                    [-2, -2, -2, -2],
                    [1, 1, -2, -2],
                    [-1, -1, 2, 2],
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 816..823

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 57.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_uniform2 = ragged_factory_ops.constant(
                [[[[3], [4, 5, 6]]], [], [], [[[1, 2, -1], []], [[8, 9], [5]]]],
                dtype=dtypes.float32,
                row_splits_dtype=dtypes.int32)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1053..1056

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

        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

            expected_sp = (  # indices, values, shape
                np.array([[0], [3]], dtype=np.int64), np.array(["a", "b"], dtype="|S"),
                np.array([13], dtype=np.int64))  # max_values = 13
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 934..938
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1261..1263

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 55.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_sp = (  # indices, values, shape
                np.array([[0], [3]], dtype=np.int64), np.array(["a", "b"], dtype="|S"),
                np.array([13], dtype=np.int64))  # max_values = 13
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 934..938
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1387..1389

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 55.

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

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

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

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

        Refactorings

        Further Reading

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

            original = [
                example(
                    features=features({
                        "a": int64_feature([truth_int[i]]),
                        "b": bytes_feature(truth_str[i])
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 667..671

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 55.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (  # indices, values, shape
                np.empty((0, 2), dtype=np.int64),  # indices
                np.empty((0,), dtype=np.int64),  # sp_a is DT_INT64
                np.array([2, 0], dtype=np.int64))  # batch == 2, max_elems = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 126..129
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1716..1719
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1773..1776

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

                elif isinstance(kwargs["sequence_features"][k],
                                parsing_ops.RaggedFeature):
                  new_values[k] = np.expand_dims(v, axis=0)
                else:
                  # Sparse tensor.
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1542..1548

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

                if isinstance(kwargs["context_features"][k],
                              (parsing_ops.FixedLenFeature, parsing_ops.RaggedFeature)):
                  new_values[k] = np.expand_dims(v, axis=0)
                else:
                  # Sparse tensor.
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1560..1566

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_a = (  # indices, values, shape
                np.empty((0, 2), dtype=np.int64),  # indices
                np.empty((0,), dtype=np.int64),  # sp_a is DT_INT64
                np.array([2, 0], dtype=np.int64))  # batch == 2, max_elems = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 593..596
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1716..1719
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1773..1776

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_c = (
                np.empty((0, 2), dtype=np.int64),  # indices
                np.empty((0,), dtype=np.int64),  # values
                np.array([0, 0], dtype=np.int64))  # shape: num_time = 0, max_feat = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 126..129
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 593..596
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1716..1719

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_st_c = (
                np.empty((0, 2), dtype=np.int64),  # indices
                np.empty((0,), dtype=np.int64),  # values
                np.array([0, 0], dtype=np.int64))  # shape: num_time = 0, max_feat = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 126..129
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 593..596
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1773..1776

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 53.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_uniform1 = ragged_factory_ops.constant(
                [[[3, 4], [5, 6]], [], [], [[1, 2], [-1, 8], [9, 5]]],
                ragged_rank=1,
                dtype=dtypes.float32,
                row_splits_dtype=dtypes.int32)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1047..1051

        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

            original = [
                example(features=features({
                    "a": float_feature([1, 1, 3]),
                })),
                example(features=features({
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 188..192

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

        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_output = {
                "st_a": expected_st_a,
                "sp": expected_sp,
                "a": [a_default],
                "b": b_default,
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 942..948

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

        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(
                [[[3], [4, 5, 6]], [], [], [[1, 2, -1], [], [8, 9], [5]]],
                dtype=dtypes.float32,
                row_splits_dtype=dtypes.int32)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 1042..1045

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

                    "features": {
                        "a":
                            parsing_ops.FixedLenFeature((1, 2, 1),
                                                        dtype=dtypes.float32,
                                                        default_value=[3.0, -3.0]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 523..529
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 577..586

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

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

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

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

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

        Refactorings

        Further Reading

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

            self._testBoth(
                {
                    "example_name": "in1",
                    "serialized": ops.convert_to_tensor(serialized),
                    "sequence_features": {
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1857..1866
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1882..1891
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1904..1915
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1936..1944

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testBoth(
                {
                    "example_name": "in1",
                    "serialized": ops.convert_to_tensor(serialized),
                    "sequence_features": {
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1839..1847
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1857..1866
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1904..1915
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1936..1944

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testBoth(
                {
                    "example_name": "in1",
                    "serialized": ops.convert_to_tensor(serialized),
                    "sequence_features": {
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1839..1847
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1882..1891
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1904..1915
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1936..1944

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testBoth(
                {
                    "example_name": "in1",
                    "serialized": ops.convert_to_tensor(serialized),
                    "sequence_features": {
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1839..1847
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1857..1866
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1882..1891
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1936..1944

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            self._testBoth(
                {
                    "example_name": "in1",
                    "serialized": ops.convert_to_tensor(serialized),
                    "sequence_features": {
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1839..1847
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1857..1866
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1882..1891
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1904..1915

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_output = {
                # Batch size batch_size, 1 time step.
                "a": np.array(truth_int, dtype=np.int64).reshape(batch_size, 1),
                # Batch size batch_size, 2 time steps.
                "b": np.array(expected_str, dtype="|S").reshape(batch_size, 2),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 660..664

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            batch_expected_out = {
                "rt_c": ragged_concat_ops.concat([expected_rt_c] * 64, axis=0),
                "rt_d": ragged_concat_ops.concat([expected_rt_d] * 64, axis=0)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2134..2136

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

            batch_feature_list_expected_out = {
                "b": ragged_concat_ops.concat([expected_b] * 64, axis=0),
                "c": ragged_concat_ops.concat([expected_c] * 64, axis=0)
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1010..1012

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 47.

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

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

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

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

        Refactorings

        Further Reading

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

                    "sequence_features": {
                        "st_a": parsing_ops.VarLenFeature(dtypes.float32),
                        "st_b": parsing_ops.VarLenFeature(dtypes.string),
                        "st_c": parsing_ops.VarLenFeature(dtypes.int64),
                        "a": parsing_ops.FixedLenSequenceFeature((2,), dtypes.int64),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1789..1793

        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

                    "sequence_features": {
                        "st_a": parsing_ops.VarLenFeature(dtypes.float32),
                        "st_b": parsing_ops.VarLenFeature(dtypes.string),
                        "st_c": parsing_ops.VarLenFeature(dtypes.int64),
                        "a": parsing_ops.FixedLenSequenceFeature((2,), dtypes.int64),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1731..1735

        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

                    "features": {
                        "a":
                            parsing_ops.FixedLenSequenceFeature(
                                shape=(),
                                dtype=dtypes.int64,
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 677..687

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

        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

                    "features": {
                        aname:
                            parsing_ops.FixedLenSequenceFeature(
                                (2, 1), dtype=dtypes.float32, allow_missing=True),
                        bname:
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 847..853
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 803..809

        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

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

                    "features": {
                        aname:
                            parsing_ops.FixedLenFeature(
                                (None, 2, 1), dtype=dtypes.float32),
                        bname:
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 860..865
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 836..842

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

        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

                feature_lists=feature_lists({
                    "a":
                        feature_list([
                            int64_feature([-1, 0, 1]),
                            int64_feature([2, 3, 4]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1624..1628

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

        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

                        feature_list([
                            int64_feature([-1, 0, 1]),
                            int64_feature([2, 3, 4]),
                            int64_feature([5, 6, 7]),
                            int64_feature([8, 9, 10]),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1970..1976

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

        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

            truth_str = [[("foo%d" % i).encode(), ("bar%d" % i).encode()]
                         for i in range(batch_size)]
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 642..643

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

                np.array([[0, 5, 0], [0, 10, 2], [3, 0, 1], [3, 3, 2], [3, 9, 0]],
                         dtype=np.int64),
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 364..365
        tensorflow/python/kernel_tests/array_ops/where_op_test.py on lines 86..87

        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

            original = [
                example(features=features({
                    "a": float_feature([1]),
                })),
                example(features=features({}))
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 472..475
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 513..516

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

        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 not context.executing_eagerly():
                with self.assertRaisesWithPredicateMatch(expected_err[0],
                                                         expected_err[1]):
                  self.evaluate(parsing_ops.parse_example(**kwargs))
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1197..1200

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

        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 expected_err:
              with self.assertRaisesWithPredicateMatch(expected_err[0],
                                                       expected_err[1]):
                self.evaluate(parsing_ops.parse_single_example(**kwargs))
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 84..87

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

        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_feature_list_output = {
                "a": np.array([[3, 4], [1, 0]], dtype=np.int64),
                "st_a": expected_st_a,
                "st_b": expected_st_b,
                "st_c": expected_st_c,
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1721..1725

        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

            expected_feature_list_output = {
                "a": np.array([[3, 4], [1, 0]], dtype=np.int64),
                "st_a": expected_st_a,
                "st_b": expected_st_b,
                "st_c": expected_st_c,
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 1778..1782

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

            test_features = {
                "rt_c":
                    parsing_ops.RaggedFeature(dtype=dtypes.float32),
                "rt_d":
                    parsing_ops.RaggedFeature(
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2083..2088

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

            sequence_features = {
                "b":
                    parsing_ops.RaggedFeature(dtype=dtypes.float32),
                "c":
                    parsing_ops.RaggedFeature(
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 982..987

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

                    "features": {
                        "sp1":
                            parsing_ops.SparseFeature("idx", "val1", dtypes.float32,
                                                      13),
                        "sp2":
        Severity: Major
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 2 other locations - About 45 mins to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 326..331
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 350..357

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

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

          def testDecodeRawV1VariableLength(self):
            words = ["string", "longer_string"]
            with self.assertRaises(errors_impl.InvalidArgumentError):
              self._decode_v1(words)
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 45 mins to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2366..2369

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

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

          def testDecodeRawV2FallbackVariableLength(self):
            words = ["string", "longer_string"]
            with self.assertRaises(errors_impl.InvalidArgumentError):
              self._decode_v2(words)
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 45 mins to fix
        tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py on lines 2361..2364

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

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

            batch_size = (
                self.evaluate(serialized).size
                if isinstance(serialized, tensor_lib.Tensor)
                else np.asarray(serialized).size
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 40 mins to fix
        tensorflow/python/data/experimental/kernel_tests/parse_example_dataset_test.py on lines 99..102

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

              if isinstance(f, parsing_ops.FixedLenFeature) and f.shape is not None:
                self.assertEqual(
                    tuple(out[k].get_shape()), tensor_shape.as_shape(f.shape))
        Severity: Minor
        Found in tensorflow/python/kernel_tests/io_ops/parsing_ops_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/kernel_tests/io_ops/parse_single_example_op_test.py on lines 904..906

        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