tensorflow/tensorflow

View on GitHub
tensorflow/python/data/kernel_tests/iterator_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File iterator_test.py has 888 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 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/data/kernel_tests/iterator_test.py - About 2 days to fix

    IteratorTest has 36 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class IteratorTest(test_base.DatasetTestBase, parameterized.TestCase):
    
      @combinations.generate(test_base.graph_only_combinations())
      def testNoGradients(self):
        component = constant_op.constant([1.])
    Severity: Minor
    Found in tensorflow/python/data/kernel_tests/iterator_test.py - About 4 hrs to fix

      Function testOneShotIteratorInsideContainer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def testOneShotIteratorInsideContainer(self):
          components = (np.arange(7),
                        np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
                        np.array(37.0) * np.arange(7))
      
      
      Severity: Minor
      Found in tensorflow/python/data/kernel_tests/iterator_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

      Avoid deeply nested control flow statements.
      Open

                  for component, result_component in zip(components, result):
                    self.assertAllEqual(component[i]**2, result_component)
              with self.assertRaises(errors.OutOfRangeError):
      Severity: Major
      Found in tensorflow/python/data/kernel_tests/iterator_test.py - About 45 mins to fix

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

          def testOneShotIterator(self):
            components = (np.arange(7),
                          np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
                          np.array(37.0) * np.arange(7))
        
        
        Severity: Minor
        Found in tensorflow/python/data/kernel_tests/iterator_test.py - About 25 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          def testOneShotIteratorCaptureByValue(self):
            components = (np.arange(7),
                          np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
                          np.array(37.0) * np.arange(7))
            tensor_components = tuple([ops.convert_to_tensor(c) for c in components])
        Severity: Minor
        Found in tensorflow/python/data/kernel_tests/iterator_test.py - About 25 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          @combinations.generate(test_base.graph_only_combinations())
          def testIteratorStringHandleFuture(self):
            dataset_3 = dataset_ops.Dataset.from_tensor_slices([1, 2, 3])
            dataset_4 = dataset_ops.Dataset.from_tensor_slices([10, 20, 30, 40])
        
        
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 4 days to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 433..489

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 422.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

          @combinations.generate(test_base.graph_only_combinations())
          def testIteratorStringHandle(self):
            dataset_3 = dataset_ops.Dataset.from_tensor_slices([1, 2, 3])
            dataset_4 = dataset_ops.Dataset.from_tensor_slices([10, 20, 30, 40])
        
        
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 4 days to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 491..554

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 422.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

            with self.cached_session() as sess:
              for _ in range(14):
                for i in range(7):
                  result = sess.run(get_next)
                  for component, result_component in zip(components, result):
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 98..105

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 98.

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

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

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

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

        Refactorings

        Further Reading

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

            with self.cached_session() as sess:
              for _ in range(14):
                for i in range(7):
                  result = sess.run(get_next)
                  for component, result_component in zip(components, result):
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 125..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 98.

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

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

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

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

        Refactorings

        Further Reading

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

            components = (np.arange(7),
                          np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
                          np.array(37.0) * np.arange(7))
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 57..59
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 263..265
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 158..160
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 109..111
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 136..138
        tensorflow/python/data/kernel_tests/window_test.py on lines 50..52

        Duplicated Code

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

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

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

        Tuning

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

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

            components = (np.arange(7),
                          np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
                          np.array(37.0) * np.arange(7))
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 57..59
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 263..265
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 158..160
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 83..85
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 136..138
        tensorflow/python/data/kernel_tests/window_test.py on lines 50..52

        Duplicated Code

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

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

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

        Tuning

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

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

            components = (np.arange(7),
                          np.array([[1, 2, 3]]) * np.arange(7)[:, np.newaxis],
                          np.array(37.0) * np.arange(7))
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 57..59
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 263..265
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 158..160
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 83..85
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 109..111
        tensorflow/python/data/kernel_tests/window_test.py on lines 50..52

        Duplicated Code

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

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

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

        Tuning

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

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

            with self.assertRaisesRegex(
                TypeError,
                r"Expected output shapes compatible with .* but got dataset with "
                r"output shapes.*"):
              iterator.make_initializer(
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 400..407

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
        Open

            with self.assertRaisesRegex(
                TypeError,
                r"Expected output types \(tf.int64, tf.float64\) but got dataset with "
                r"output types \(tf.int32, tf.float32\)."):
              iterator.make_initializer(
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 412..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 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

            @function.Defun(dtypes.string)
            def loading_func(h):
              remote_itr = iterator_ops.Iterator.from_string_handle(
                  h, dataset_ops.get_legacy_output_types(itr),
                  dataset_ops.get_legacy_output_shapes(itr))
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 69..74
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 636..641

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            @function.Defun(dtypes.string)
            def _remote_fn(h):
              remote_iterator = iterator_ops.Iterator.from_string_handle(
                  h, dataset_ops.get_legacy_output_types(dataset_3),
                  dataset_ops.get_legacy_output_shapes(dataset_3))
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 69..74
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 713..718

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            with ops.device("/job:localhost/replica:0/task:0/cpu:1"):
              dataset_3 = dataset_ops.Dataset.from_tensor_slices([1, 2, 3])
              iterator_3 = dataset_ops.make_one_shot_iterator(dataset_3)
              iterator_3_handle = iterator_3.string_handle()
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 48..51
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 743..746

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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 3 locations. Consider refactoring.
        Open

            with ops.device("/job:localhost/replica:0/task:0/cpu:0"):
              dataset_3 = dataset_ops.Dataset.from_tensor_slices([1, 2, 3])
              iterator_3 = dataset_ops.make_one_shot_iterator(dataset_3)
              iterator_3_handle = iterator_3.string_handle()
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 48..51
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 631..634

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

            with ops.device("/job:localhost/replica:0/task:0/cpu:0"):
              target_placeholder = array_ops.placeholder(dtypes.string, shape=[])
              remote_op = functional_ops.remote_call(
                  args=[iterator_3_handle],
                  Tout=[dtypes.int32],
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 76..80

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 46.

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

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

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

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

        Refactorings

        Further Reading

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

                  combinations.combine(
                      expected_element_structure={
                          "a":
                              tensor.TensorSpec([], dtypes.float32),
                          "b": (tensor.TensorSpec([1], dtypes.string),
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/data/kernel_tests/optional_test.py on lines 55..60

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

            self.assertEqual([c.shape[1:] for c in components],
                             [t.shape for t in get_next])
        Severity: Minor
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 95..96

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

            self.assertEqual([c.shape[1:] for c in components],
                             [t.shape for t in get_next])
        Severity: Minor
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 122..123

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

            def _map_fn(x, y, z):
              return math_ops.square(x), math_ops.square(y), math_ops.square(z)
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 7 other locations - About 35 mins to fix
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 61..62
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 267..268
        tensorflow/python/data/experimental/kernel_tests/optimization/filter_parallelization_test.py on lines 71..72
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 162..163
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 87..88
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 142..143
        tensorflow/python/data/kernel_tests/window_test.py on lines 54..55

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

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

              def _map_fn(x, y, z):
                return math_ops.square(x), math_ops.square(y), math_ops.square(z)
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 7 other locations - About 35 mins to fix
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 61..62
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 267..268
        tensorflow/python/data/experimental/kernel_tests/optimization/filter_parallelization_test.py on lines 71..72
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 162..163
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 87..88
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 114..115
        tensorflow/python/data/kernel_tests/window_test.py on lines 54..55

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

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

            def _map_fn(x, y, z):
              return math_ops.square(x), math_ops.square(y), math_ops.square(z)
        Severity: Major
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 7 other locations - About 35 mins to fix
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 61..62
        tensorflow/python/data/experimental/kernel_tests/map_and_batch_test.py on lines 267..268
        tensorflow/python/data/experimental/kernel_tests/optimization/filter_parallelization_test.py on lines 71..72
        tensorflow/python/data/kernel_tests/iterator_cluster_test.py on lines 162..163
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 114..115
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 142..143
        tensorflow/python/data/kernel_tests/window_test.py on lines 54..55

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

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

              with self.assertRaises(errors.InvalidArgumentError):
                print(sess.run(
                    feedable_int_vector.get_next(),
                    feed_dict={handle_placeholder: handle_float_vector}))
        Severity: Minor
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 616..619

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

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

              with self.assertRaises(errors.InvalidArgumentError):
                print(sess.run(
                    feedable_int_vector.get_next(),
                    feed_dict={handle_placeholder: handle_int_scalar}))
        Severity: Minor
        Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/data/kernel_tests/iterator_test.py on lines 621..624

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status