tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/metrics_test.py

Summary

Maintainability
F
5 mos
Test Coverage

File metrics_test.py has 3706 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2016 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/metrics_test.py - About 1 wk to fix

    AUCTest has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AUCTest(test.TestCase):
    
      def setUp(self):
        np.random.seed(1)
        ops.reset_default_graph()
    Severity: Minor
    Found in tensorflow/python/kernel_tests/metrics_test.py - About 2 hrs to fix

      Function testWithMultipleUpdates has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def testWithMultipleUpdates(self):
          num_samples = 1000
          batch_size = 10
          num_batches = int(num_samples / batch_size)
      
      
      Severity: Minor
      Found in tensorflow/python/kernel_tests/metrics_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 _binary_3d_label_to_sparse_value has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def _binary_3d_label_to_sparse_value(labels):
        """Convert dense 3D binary indicator tensor to sparse tensor.
      
        Only 1 values in `labels` are included in result.
      
      
      Severity: Minor
      Found in tensorflow/python/kernel_tests/metrics_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 testWithMultipleUpdates has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def testWithMultipleUpdates(self):
          num_samples = 1000
          batch_size = 10
          num_batches = int(num_samples / batch_size)
      
      
      Severity: Minor
      Found in tensorflow/python/kernel_tests/metrics_test.py - About 55 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function _test_recall_at_k has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _test_recall_at_k(predictions,
      Severity: Major
      Found in tensorflow/python/kernel_tests/metrics_test.py - About 50 mins to fix

        Function _test_precision_at_k has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _test_precision_at_k(predictions,
        Severity: Major
        Found in tensorflow/python/kernel_tests/metrics_test.py - About 50 mins to fix

          Function _test_precision_at_top_k has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _test_precision_at_top_k(
          Severity: Major
          Found in tensorflow/python/kernel_tests/metrics_test.py - About 50 mins to fix

            Function _test_recall_at_top_k has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _test_recall_at_top_k(
            Severity: Major
            Found in tensorflow/python/kernel_tests/metrics_test.py - About 50 mins to fix

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

              def _test_average_precision_at_k(predictions,
              Severity: Minor
              Found in tensorflow/python/kernel_tests/metrics_test.py - About 45 mins to fix

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

                def _binary_2d_label_to_1d_sparse_value(labels):
                  """Convert dense 2D binary indicator to sparse ID.
                
                  Only 1 values in `labels` are included in result.
                
                
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_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 _binary_2d_label_to_2d_sparse_value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def _binary_2d_label_to_2d_sparse_value(labels):
                  """Convert dense 2D binary indicator to sparse ID.
                
                  Only 1 values in `labels` are included in result.
                
                
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                class FalseNegativesTest(test.TestCase):
                
                  def setUp(self):
                    np.random.seed(1)
                    ops.reset_default_graph()
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 4 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4283..4333
                tensorflow/python/kernel_tests/metrics_test.py on lines 4390..4440
                tensorflow/python/kernel_tests/metrics_test.py on lines 4495..4545

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 413.

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

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

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

                class TruePositivesTest(test.TestCase):
                
                  def setUp(self):
                    np.random.seed(1)
                    ops.reset_default_graph()
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 4 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4178..4228
                tensorflow/python/kernel_tests/metrics_test.py on lines 4283..4333
                tensorflow/python/kernel_tests/metrics_test.py on lines 4390..4440

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 413.

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

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

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

                class TrueNegativesTest(test.TestCase):
                
                  def setUp(self):
                    np.random.seed(1)
                    ops.reset_default_graph()
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 4 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4178..4228
                tensorflow/python/kernel_tests/metrics_test.py on lines 4283..4333
                tensorflow/python/kernel_tests/metrics_test.py on lines 4495..4545

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 413.

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

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

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

                class FalsePositivesTest(test.TestCase):
                
                  def setUp(self):
                    np.random.seed(1)
                    ops.reset_default_graph()
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 4 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4178..4228
                tensorflow/python/kernel_tests/metrics_test.py on lines 4390..4440
                tensorflow/python/kernel_tests/metrics_test.py on lines 4495..4545

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 413.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMultipleUpdatesWithWeights(self):
                    num_classes = 2
                    with self.cached_session() as sess:
                      # Create the queue that populates the predictions.
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 4 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3725..3769

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 411.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMultipleUpdatesWithWeights(self):
                    num_classes = 2
                    with self.cached_session() as sess:
                      # Create the queue that populates the predictions.
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 4 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4046..4090

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 411.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMultipleUpdatesWithMissingClass(self):
                    # Test the case where there are no predictions and labels for
                    # one class, and thus there is one row and one column with
                    # zero entries in the confusion matrix.
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3693..3723

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 290.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMultipleUpdates(self):
                    num_classes = 3
                    with self.cached_session() as sess:
                      # Create the queue that populates the predictions.
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4092..4128

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 290.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testWeighted1d(self):
                    with self.cached_session() as sess:
                      # Create the queue that populates the values.
                      values_queue = data_flow_ops.FIFOQueue(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 437..463

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 253.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testBinaryWeighted1d(self):
                    with self.cached_session() as sess:
                      # Create the queue that populates the values.
                      values_queue = data_flow_ops.FIFOQueue(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 465..491

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 253.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testWeighted2d_2(self):
                    with self.cached_session() as sess:
                      # Create the queue that populates the values.
                      values_queue = data_flow_ops.FIFOQueue(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 493..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 249.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testWeighted2d_1(self):
                    with self.cached_session() as sess:
                      # Create the queue that populates the values.
                      values_queue = data_flow_ops.FIFOQueue(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 days to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 521..547

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 249.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _test_recall_at_k(predictions,
                                      labels,
                                      k,
                                      expected,
                                      class_id=None,
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2015..2043

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 209.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _test_precision_at_k(predictions,
                                         labels,
                                         k,
                                         expected,
                                         class_id=None,
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2525..2553

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 209.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSingleUpdateWithErrorAndWeights1(self):
                    np_predictions = np.matrix(('1 0 0;' '0 0 -1;' '1 0 0'))
                    np_labels = np.matrix(('1 0 0;' '0 0 1;' '0 1 0'))
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3527..3545

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 183.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSingleUpdateWithErrorAndWeights2(self):
                    np_predictions = np.matrix(('1 0 0;' '0 0 -1;' '1 0 0'))
                    np_labels = np.matrix(('1 0 0;' '0 0 1;' '0 1 0'))
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3507..3525

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 183.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSomeCorrect_multipleInputDtypes(self):
                    for dtype in (dtypes_lib.bool, dtypes_lib.int32, dtypes_lib.float32):
                      predictions = math_ops.cast(
                          constant_op.constant([1, 0, 1, 0], shape=(1, 4)), dtype=dtype)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1011..1023

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 160.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSomeCorrect_multipleInputDtypes(self):
                    for dtype in (dtypes_lib.bool, dtypes_lib.int32, dtypes_lib.float32):
                      predictions = math_ops.cast(
                          constant_op.constant([1, 0, 1, 0], shape=(1, 4)), dtype=dtype)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 811..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 160.

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

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

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

                  @test_util.run_deprecated_v1
                  def testUnweighted(self):
                    predictions = constant_op.constant(((0.9, 0.2, 0.8, 0.1),
                                                        (0.2, 0.9, 0.7, 0.6),
                                                        (0.1, 0.2, 0.4, 0.3)))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4245..4260
                tensorflow/python/kernel_tests/metrics_test.py on lines 4350..4365
                tensorflow/python/kernel_tests/metrics_test.py on lines 4562..4577

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 159.

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

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

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

                  @test_util.run_deprecated_v1
                  def testUnweighted(self):
                    predictions = constant_op.constant(((0.9, 0.2, 0.8, 0.1),
                                                        (0.2, 0.9, 0.7, 0.6),
                                                        (0.1, 0.2, 0.4, 0.3)))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4245..4260
                tensorflow/python/kernel_tests/metrics_test.py on lines 4350..4365
                tensorflow/python/kernel_tests/metrics_test.py on lines 4457..4472

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 159.

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

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

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

                  @test_util.run_deprecated_v1
                  def testUnweighted(self):
                    predictions = constant_op.constant(((0.9, 0.2, 0.8, 0.1),
                                                        (0.2, 0.9, 0.7, 0.6),
                                                        (0.1, 0.2, 0.4, 0.3)))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4245..4260
                tensorflow/python/kernel_tests/metrics_test.py on lines 4457..4472
                tensorflow/python/kernel_tests/metrics_test.py on lines 4562..4577

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 159.

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

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

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

                  @test_util.run_deprecated_v1
                  def testUnweighted(self):
                    predictions = constant_op.constant(((0.9, 0.2, 0.8, 0.1),
                                                        (0.2, 0.9, 0.7, 0.6),
                                                        (0.1, 0.2, 0.4, 0.3)))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4350..4365
                tensorflow/python/kernel_tests/metrics_test.py on lines 4457..4472
                tensorflow/python/kernel_tests/metrics_test.py on lines 4562..4577

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 159.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_uniform(
                        (10, 3), maxval=1, dtype=dtypes_lib.float32, seed=1)
                    labels = random_ops.random_uniform(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1470..1490

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 159.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_uniform(
                        (10, 3), maxval=1, dtype=dtypes_lib.float32, seed=1)
                    labels = random_ops.random_uniform(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1617..1637

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 159.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSingleUpdateWithErrorAndWeights(self):
                    predictions = constant_op.constant(
                        [2, 4, 6, 8], shape=(1, 4), dtype=dtypes_lib.float32)
                    labels = constant_op.constant(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3005..3018

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 158.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSingleUpdateWithErrorAndWeights(self):
                    predictions = constant_op.constant(
                        [2, 4, 6, 8], shape=(1, 4), dtype=dtypes_lib.float32)
                    labels = constant_op.constant(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3186..3199

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 158.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_uniform(
                        (10, 3), maxval=3, dtype=dtypes_lib.int64, seed=1)
                    labels = random_ops.random_uniform(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 778..796
                tensorflow/python/kernel_tests/metrics_test.py on lines 978..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 154.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_uniform(
                        (10, 3), maxval=1, dtype=dtypes_lib.int64, seed=1)
                    labels = random_ops.random_uniform(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 597..615
                tensorflow/python/kernel_tests/metrics_test.py on lines 978..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 154.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_uniform(
                        (10, 3), maxval=1, dtype=dtypes_lib.int64, seed=1)
                    labels = random_ops.random_uniform(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 597..615
                tensorflow/python/kernel_tests/metrics_test.py on lines 778..796

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 154.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSingleUpdateWithError1(self):
                    np_labels = np.matrix(('1 0 0;' '0 0 1;' '0 1 0'))
                    np_predictions = np.matrix(('1 0 0;' '0 0 -1;' '1 0 0'))
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3485..3505

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 154.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testSingleUpdateWithError2(self):
                    np_predictions = np.matrix(
                        ('0.819031913261206 0.567041924552012 0.087465312324590;'
                         '-0.665139432070255 -0.739487441769973 -0.103671883216994;'
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3468..3483

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 154.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testThirdIncorrectAUCPRSpecialCase(self):
                    with self.cached_session():
                      predictions = constant_op.constant(
                          [0.0, 0.1, 0.2, 0.33, 0.3, 0.4, 0.5],
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1284..1298

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 150.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testAnotherIncorrectAUCPRSpecialCase(self):
                    with self.cached_session():
                      predictions = constant_op.constant(
                          [0.1, 0.4, 0.35, 0.8, 0.1, 0.135, 0.81],
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1300..1314

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 150.

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

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

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

                  @test_util.run_deprecated_v1
                  def testSomeCorrectHighSensitivity(self):
                    predictions_values = [0.1, 0.2, 0.4, 0.3, 0.0, 0.1, 0.45, 0.5, 0.8, 0.9]
                    labels_values = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1522..1537
                tensorflow/python/kernel_tests/metrics_test.py on lines 1653..1667
                tensorflow/python/kernel_tests/metrics_test.py on lines 1669..1683

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 142.

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

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

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

                  @test_util.run_deprecated_v1
                  def testSomeCorrectLowSpecificity(self):
                    predictions_values = [0.0, 0.1, 0.2, 0.3, 0.4, 0.01, 0.02, 0.25, 0.26, 0.26]
                    labels_values = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1506..1520
                tensorflow/python/kernel_tests/metrics_test.py on lines 1522..1537
                tensorflow/python/kernel_tests/metrics_test.py on lines 1653..1667

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 142.

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

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

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

                  @test_util.run_deprecated_v1
                  def testSomeCorrectHighSpecificity(self):
                    predictions_values = [0.0, 0.1, 0.2, 0.3, 0.4, 0.1, 0.45, 0.5, 0.8, 0.9]
                    labels_values = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1506..1520
                tensorflow/python/kernel_tests/metrics_test.py on lines 1522..1537
                tensorflow/python/kernel_tests/metrics_test.py on lines 1669..1683

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 142.

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

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

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

                  @test_util.run_deprecated_v1
                  def testSomeCorrectLowSensitivity(self):
                    predictions_values = [0.1, 0.2, 0.4, 0.3, 0.0, 0.1, 0.2, 0.2, 0.26, 0.26]
                    labels_values = [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
                
                
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1506..1520
                tensorflow/python/kernel_tests/metrics_test.py on lines 1653..1667
                tensorflow/python/kernel_tests/metrics_test.py on lines 1669..1683

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 142.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_normal((10, 3), seed=1)
                    labels = random_ops.random_normal((10, 3), seed=2)
                    error, update_op = metrics.mean_absolute_error(labels, predictions)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3142..3158
                tensorflow/python/kernel_tests/metrics_test.py on lines 3329..3345

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 138.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_normal((10, 3), seed=1)
                    labels = random_ops.random_normal((10, 3), seed=2)
                    error, update_op = metrics.root_mean_squared_error(labels, predictions)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2987..3003
                tensorflow/python/kernel_tests/metrics_test.py on lines 3142..3158

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 138.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testValueTensorIsIdempotent(self):
                    predictions = random_ops.random_normal((10, 3), seed=1)
                    labels = random_ops.random_normal((10, 3), seed=2)
                    error, update_op = metrics.mean_squared_error(labels, predictions)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2987..3003
                tensorflow/python/kernel_tests/metrics_test.py on lines 3329..3345

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 138.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    prec, _ = metrics.precision_at_thresholds(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1739..1753

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 132.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, precision_op = metrics.precision_at_thresholds(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 day to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1724..1737

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 132.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testAllIncorrect(self):
                    np_inputs = np.random.randint(0, 2, size=(100, 1))
                
                    predictions = constant_op.constant(np_inputs)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 7 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 921..932

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 120.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testAllIncorrect(self):
                    inputs = np.random.randint(0, 2, size=(100, 1))
                
                    predictions = constant_op.constant(inputs)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 7 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1055..1066

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 120.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testAllCorrect(self):
                    predictions = array_ops.zeros([40])
                    labels = array_ops.zeros([40])
                    num_classes = 1
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 7 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4130..4140

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 116.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testAllCorrect(self):
                    predictions = array_ops.zeros([40])
                    labels = array_ops.zeros([40])
                    num_classes = 1
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 7 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3833..3842

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 116.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMissingClassOverallSmall(self):
                    labels = constant_op.constant([0])
                    predictions = constant_op.constant([0])
                    num_classes = 2
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 7 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3844..3853

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testAllWrong(self):
                    predictions = array_ops.zeros([40])
                    labels = array_ops.ones([40])
                    num_classes = 2
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 7 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3909..3918

                Duplicated Code

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

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

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

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

                    with self.cached_session():
                      variables.local_variables_initializer().run()
                      weighted_tp = 3.0 + 4.0
                      weighted_positives = (1.0 + 3.0) + (4.0 + 2.0)
                      expected_precision = weighted_tp / weighted_positives
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 6 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 850..858
                tensorflow/python/kernel_tests/metrics_test.py on lines 871..879

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 100.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 self.cached_session():
                      variables.local_variables_initializer().run()
                      weighted_tp = 2.0 + 2.0
                      weighted_positives = (2.0 + 2.0) + (2.0 + 2.0)
                      expected_precision = weighted_tp / weighted_positives
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 6 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 871..879
                tensorflow/python/kernel_tests/metrics_test.py on lines 911..919

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 100.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 self.cached_session():
                      variables.local_variables_initializer().run()
                      weighted_tp = 2.0 + 5.0
                      weighted_positives = (2.0 + 2.0) + (5.0 + 5.0)
                      expected_precision = weighted_tp / weighted_positives
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 6 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 850..858
                tensorflow/python/kernel_tests/metrics_test.py on lines 911..919

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 100.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.cached_session():
                      self.evaluate(variables.local_variables_initializer())
                      weighted_tp = 2.0 + 5.0
                      weighted_t = (2.0 + 2.0) + (5.0 + 5.0)
                      expected_precision = weighted_tp / weighted_t
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 6 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1047..1053

                Duplicated Code

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

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

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

                    with self.cached_session():
                      self.evaluate(variables.local_variables_initializer())
                      weighted_tp = 3.0 + 1.0
                      weighted_t = (2.0 + 3.0) + (4.0 + 1.0)
                      expected_precision = weighted_tp / weighted_t
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 6 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1032..1038

                Duplicated Code

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

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

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

                    with self.cached_session():
                      variables.local_variables_initializer().run()
                      weighted_tp = 3.0 + 4.0
                      weighted_positives = (1.0 + 3.0) + (4.0 + 2.0)
                      expected_precision = weighted_tp / weighted_positives
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 832..838

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 96.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.cached_session():
                      variables.local_variables_initializer().run()
                      weighted_tp = 2.0 + 5.0
                      weighted_positives = (2.0 + 2.0) + (5.0 + 5.0)
                      expected_precision = weighted_tp / weighted_positives
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 890..896

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 96.

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

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

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

                    for i in range(4):
                      k = i + 1
                      self._test_precision_at_k(
                          predictions, labels, k, expected=precision_ex1[i])
                      self._test_precision_at_top_k(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2194..2201
                tensorflow/python/kernel_tests/metrics_test.py on lines 2250..2257

                Duplicated Code

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

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

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

                    for i in range(4):
                      k = i + 1
                      self._test_precision_at_k(
                          predictions, labels, k, expected=precision_ex1[i])
                      self._test_precision_at_top_k(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2176..2183
                tensorflow/python/kernel_tests/metrics_test.py on lines 2194..2201

                Duplicated Code

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

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

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

                    for i in range(4):
                      k = i + 1
                      self._test_precision_at_k(
                          predictions, labels, k, expected=precision_ex2[i])
                      self._test_precision_at_top_k(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2176..2183
                tensorflow/python/kernel_tests/metrics_test.py on lines 2250..2257

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.mean_relative_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3045..3053

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 87.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_relative_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 5 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3035..3043

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 87.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollections(self):
                    my_collection_name = '__metrics__'
                    mean_iou, _ = metrics.mean_iou(
                        predictions=array_ops.ones([10, 1]),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.sensitivity_at_specificity(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.specificity_at_sensitivity(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_iou(
                        predictions=array_ops.ones([10, 1]),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_cosine_distance(
                        predictions=array_ops.ones((10, 3)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.mean_cosine_distance(
                        predictions=array_ops.ones((10, 3)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.sensitivity_at_specificity(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollections(self):
                    my_collection_name = '__metrics__'
                    mean_accuracy, _ = metrics.mean_per_class_accuracy(
                        predictions=array_ops.ones([10, 1]),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_per_class_accuracy(
                        predictions=array_ops.ones([10, 1]),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1460..1468
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.specificity_at_sensitivity(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 9 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1450..1458
                tensorflow/python/kernel_tests/metrics_test.py on lines 1597..1605
                tensorflow/python/kernel_tests/metrics_test.py on lines 1607..1615
                tensorflow/python/kernel_tests/metrics_test.py on lines 3414..3422
                tensorflow/python/kernel_tests/metrics_test.py on lines 3424..3432
                tensorflow/python/kernel_tests/metrics_test.py on lines 3636..3644
                tensorflow/python/kernel_tests/metrics_test.py on lines 3646..3654
                tensorflow/python/kernel_tests/metrics_test.py on lines 3956..3965
                tensorflow/python/kernel_tests/metrics_test.py on lines 3967..3975

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testLabelsAndWeightsOfDifferentSizeRaisesValueError(self):
                    predictions = array_ops.ones([10])
                    labels = array_ops.ones([10])
                    weights = array_ops.zeros([9])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3984..3991

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 76.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testLabelsAndWeightsOfDifferentSizeRaisesValueError(self):
                    predictions = array_ops.ones([10])
                    labels = array_ops.ones([10])
                    weights = array_ops.zeros([9])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3663..3669

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 76.

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.precision(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.auc(predictions=array_ops.ones((10, 1)),
                                          labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.root_mean_squared_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.mean_squared_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.accuracy(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.recall(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.accuracy(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.mean_absolute_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.root_mean_squared_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.precision(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_absolute_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.auc(predictions=array_ops.ones((10, 1)),
                                               labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.recall(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3133..3140
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_squared_error(
                        predictions=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 13 other locations - About 4 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 564..571
                tensorflow/python/kernel_tests/metrics_test.py on lines 573..580
                tensorflow/python/kernel_tests/metrics_test.py on lines 760..767
                tensorflow/python/kernel_tests/metrics_test.py on lines 769..776
                tensorflow/python/kernel_tests/metrics_test.py on lines 960..967
                tensorflow/python/kernel_tests/metrics_test.py on lines 969..976
                tensorflow/python/kernel_tests/metrics_test.py on lines 1094..1100
                tensorflow/python/kernel_tests/metrics_test.py on lines 1102..1108
                tensorflow/python/kernel_tests/metrics_test.py on lines 2969..2976
                tensorflow/python/kernel_tests/metrics_test.py on lines 2978..2985
                tensorflow/python/kernel_tests/metrics_test.py on lines 3124..3131
                tensorflow/python/kernel_tests/metrics_test.py on lines 3311..3318
                tensorflow/python/kernel_tests/metrics_test.py on lines 3320..3327

                Duplicated Code

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

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

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

                    labels = sparse_tensor.SparseTensorValue(
                        indices=[[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2],
                                 [1, 3]],
                        # values -1 and 10 are outside the [0, n_classes) range.
                        values=np.array([2, 7, -1, 8, 1, 2, 5, 10], np.int64),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2359..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 73.

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

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

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

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

                Refactorings

                Further Reading

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

                    sp_labels = sparse_tensor.SparseTensorValue(
                        indices=[[0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2],
                                 [1, 3]],
                        # values -1 and 10 are outside the [0, n_classes) range and are ignored.
                        values=np.array([2, 7, -1, 8, 1, 2, 5, 10], np.int64),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2780..2785

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 73.

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

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

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

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

                Refactorings

                Further Reading

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

                def _enqueue_vector(sess, queue, values, shape=None):
                  if not shape:
                    shape = (1, len(values))
                  dtype = queue.dtypes[0]
                  sess.run(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/framework/meta_graph_test.py on lines 900..905

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 72.

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.percentage_below(
                        values=array_ops.ones((10,)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3570..3577

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.percentage_below(
                        values=array_ops.ones((10,)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3561..3568

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 65.

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

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

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

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

                Refactorings

                Further Reading

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

                    avg_precision_ex1 = (0.0 / 1, precision_ex1[1] / 2, precision_ex1[1] / 3,
                                         (precision_ex1[1] + precision_ex1[3]) / 4)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2174..2175

                Duplicated Code

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

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

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

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

                    avg_precision_ex1 = (0.0 / 1, precision_ex1[1] / 2, precision_ex1[1] / 3,
                                         (precision_ex1[1] + precision_ex1[3]) / 4)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2248..2249

                Duplicated Code

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

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

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

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

                    labels = _binary_3d_label_to_sparse_value(
                        [[[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]],
                         [[0, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2398..2400
                tensorflow/python/kernel_tests/metrics_test.py on lines 2436..2438
                tensorflow/python/kernel_tests/metrics_test.py on lines 2472..2474

                Duplicated Code

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

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

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

                    labels = _binary_3d_label_to_sparse_value(
                        [[[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]],
                         [[0, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2398..2400
                tensorflow/python/kernel_tests/metrics_test.py on lines 2417..2419
                tensorflow/python/kernel_tests/metrics_test.py on lines 2472..2474

                Duplicated Code

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

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

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

                    labels = _binary_3d_label_to_sparse_value(
                        [[[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]],
                         [[0, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2398..2400
                tensorflow/python/kernel_tests/metrics_test.py on lines 2417..2419
                tensorflow/python/kernel_tests/metrics_test.py on lines 2436..2438

                Duplicated Code

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

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

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

                    labels = _binary_3d_label_to_sparse_value(
                        [[[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]],
                         [[0, 1, 1, 0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2417..2419
                tensorflow/python/kernel_tests/metrics_test.py on lines 2436..2438
                tensorflow/python/kernel_tests/metrics_test.py on lines 2472..2474

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean_tensor(
                        array_ops.ones([4, 3]), updates_collections=[my_collection_name])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 179..184
                tensorflow/python/kernel_tests/metrics_test.py on lines 186..191
                tensorflow/python/kernel_tests/metrics_test.py on lines 360..365

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testUpdatesCollection(self):
                    my_collection_name = '__updates__'
                    _, update_op = metrics.mean(
                        array_ops.ones([4, 3]), updates_collections=[my_collection_name])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 179..184
                tensorflow/python/kernel_tests/metrics_test.py on lines 360..365
                tensorflow/python/kernel_tests/metrics_test.py on lines 367..372

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.mean_tensor(
                        array_ops.ones([4, 3]), metrics_collections=[my_collection_name])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 179..184
                tensorflow/python/kernel_tests/metrics_test.py on lines 186..191
                tensorflow/python/kernel_tests/metrics_test.py on lines 367..372

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testMetricsCollection(self):
                    my_collection_name = '__metrics__'
                    mean, _ = metrics.mean(
                        array_ops.ones([4, 3]), metrics_collections=[my_collection_name])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 186..191
                tensorflow/python/kernel_tests/metrics_test.py on lines 360..365
                tensorflow/python/kernel_tests/metrics_test.py on lines 367..372

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testPredictionsAndLabelsOfDifferentSizeRaisesValueError(self):
                    predictions = array_ops.ones([10, 3])
                    labels = array_ops.ones([10, 4])
                    with self.assertRaises(ValueError):
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3656..3661

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testPredictionsAndLabelsOfDifferentSizeRaisesValueError(self):
                    predictions = array_ops.ones([10, 3])
                    labels = array_ops.ones([10, 4])
                    with self.assertRaises(ValueError):
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 3 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3977..3982

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.false_negatives_at_thresholds(
                        predictions=array_ops.ones((10, 1)),
                        labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4342..4348
                tensorflow/python/kernel_tests/metrics_test.py on lines 4449..4455
                tensorflow/python/kernel_tests/metrics_test.py on lines 4554..4560

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.true_positives_at_thresholds(
                        predictions=array_ops.ones((10, 1)),
                        labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4237..4243
                tensorflow/python/kernel_tests/metrics_test.py on lines 4342..4348
                tensorflow/python/kernel_tests/metrics_test.py on lines 4449..4455

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.true_negatives_at_thresholds(
                        predictions=array_ops.ones((10, 1)),
                        labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4237..4243
                tensorflow/python/kernel_tests/metrics_test.py on lines 4342..4348
                tensorflow/python/kernel_tests/metrics_test.py on lines 4554..4560

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.false_positives_at_thresholds(
                        predictions=array_ops.ones((10, 1)),
                        labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4237..4243
                tensorflow/python/kernel_tests/metrics_test.py on lines 4449..4455
                tensorflow/python/kernel_tests/metrics_test.py on lines 4554..4560

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 59.

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

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

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

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

                Refactorings

                Further Reading

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

                    predictions = [[[0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9],
                                    [0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6]],
                                   [[0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6],
                                    [0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2411..2414
                tensorflow/python/kernel_tests/metrics_test.py on lines 2430..2433
                tensorflow/python/kernel_tests/metrics_test.py on lines 2466..2469

                Duplicated Code

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

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

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

                    predictions = [[[0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9],
                                    [0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6]],
                                   [[0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6],
                                    [0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2392..2395
                tensorflow/python/kernel_tests/metrics_test.py on lines 2430..2433
                tensorflow/python/kernel_tests/metrics_test.py on lines 2466..2469

                Duplicated Code

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

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

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

                    predictions = [[[0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9],
                                    [0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6]],
                                   [[0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6],
                                    [0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2392..2395
                tensorflow/python/kernel_tests/metrics_test.py on lines 2411..2414
                tensorflow/python/kernel_tests/metrics_test.py on lines 2466..2469

                Duplicated Code

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

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

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

                    predictions = [[[0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9],
                                    [0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6]],
                                   [[0.3, 0.0, 0.7, 0.2, 0.4, 0.9, 0.5, 0.8, 0.1, 0.6],
                                    [0.5, 0.1, 0.6, 0.3, 0.8, 0.0, 0.7, 0.2, 0.4, 0.9]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2392..2395
                tensorflow/python/kernel_tests/metrics_test.py on lines 2411..2414
                tensorflow/python/kernel_tests/metrics_test.py on lines 2430..2433

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.specificity_at_sensitivity(
                        predictions=array_ops.ones((10, 1)),
                        labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1585..1595

                Duplicated Code

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.sensitivity_at_specificity(
                        predictions=array_ops.ones((10, 1)),
                        labels=array_ops.ones((10, 1)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 1438..1448

                Duplicated Code

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

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

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

                Tuning

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.mean_cosine_distance(
                        predictions=array_ops.ones((10, 3)),
                        labels=array_ops.ones((10, 3)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3947..3954

                Duplicated Code

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

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

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

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.mean_per_class_accuracy(
                        predictions=array_ops.ones([10, 1]),
                        labels=array_ops.ones([10, 1]),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3403..3411

                Duplicated Code

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

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

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

                    self._labels = (
                        _binary_2d_label_to_1d_sparse_value(indicator_labels),
                        _binary_2d_label_to_2d_sparse_value(indicator_labels), np.array(
                            class_labels, dtype=np.int64), np.array(
                                [[class_id] for class_id in class_labels], dtype=np.int64))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2596..2600

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 54.

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

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

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

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

                Refactorings

                Further Reading

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

                    self._labels = (
                        _binary_2d_label_to_1d_sparse_value(indicator_labels),
                        _binary_2d_label_to_2d_sparse_value(indicator_labels), np.array(
                            class_labels, dtype=np.int64), np.array(
                                [[class_id] for class_id in class_labels], dtype=np.int64))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2113..2117

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 54.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.mean_squared_error(
                        predictions=array_ops.ones((10, 1)), labels=array_ops.ones((10, 1)))
                    _assert_metric_variables(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 753..758
                tensorflow/python/kernel_tests/metrics_test.py on lines 952..958
                tensorflow/python/kernel_tests/metrics_test.py on lines 2962..2967
                tensorflow/python/kernel_tests/metrics_test.py on lines 3303..3309

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 53.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.recall(
                        predictions=array_ops.ones((10, 1)), labels=array_ops.ones((10, 1)))
                    _assert_metric_variables(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 753..758
                tensorflow/python/kernel_tests/metrics_test.py on lines 2962..2967
                tensorflow/python/kernel_tests/metrics_test.py on lines 3117..3122
                tensorflow/python/kernel_tests/metrics_test.py on lines 3303..3309

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 53.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.mean_absolute_error(
                        predictions=array_ops.ones((10, 1)), labels=array_ops.ones((10, 1)))
                    _assert_metric_variables(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 753..758
                tensorflow/python/kernel_tests/metrics_test.py on lines 952..958
                tensorflow/python/kernel_tests/metrics_test.py on lines 3117..3122
                tensorflow/python/kernel_tests/metrics_test.py on lines 3303..3309

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 53.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.root_mean_squared_error(
                        predictions=array_ops.ones((10, 1)), labels=array_ops.ones((10, 1)))
                    _assert_metric_variables(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 753..758
                tensorflow/python/kernel_tests/metrics_test.py on lines 952..958
                tensorflow/python/kernel_tests/metrics_test.py on lines 2962..2967
                tensorflow/python/kernel_tests/metrics_test.py on lines 3117..3122

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 53.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.precision(
                        predictions=array_ops.ones((10, 1)), labels=array_ops.ones((10, 1)))
                    _assert_metric_variables(self, ('precision/false_positives/count:0',
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 952..958
                tensorflow/python/kernel_tests/metrics_test.py on lines 2962..2967
                tensorflow/python/kernel_tests/metrics_test.py on lines 3117..3122
                tensorflow/python/kernel_tests/metrics_test.py on lines 3303..3309

                Duplicated Code

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

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

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

                    for labels in (sparse_labels, dense_labels):
                      # Classes 1,3,8 have 0 predictions, classes -1 and 10 are out of range.
                      for class_id in (-1, 1, 3, 8, 10):
                        self._test_precision_at_k(
                            predictions, labels, k=5, expected=NAN, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2403..2407

                Duplicated Code

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

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

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

                    weights = array_ops.concat([
                        constant_op.constant(0, shape=[1]), constant_op.constant(1, shape=[8]),
                        constant_op.constant(0, shape=[1])
                    ], 0)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3872..3879

                Duplicated Code

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

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

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

                    weights = array_ops.concat(
                        [
                            constant_op.constant(
                                0, shape=[1]), constant_op.constant(
                                    1, shape=[8]), constant_op.constant(
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 4163..4166

                Duplicated Code

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

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

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

                    for class_id in (-1, 1, 3, 8, 10):
                      self._test_precision_at_k(
                          predictions, labels, k=5, expected=NAN, class_id=class_id)
                      self._test_precision_at_top_k(
                          predictions_idx, labels, k=5, expected=NAN, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2294..2300

                Duplicated Code

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

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

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

                    for labels in (sparse_labels, dense_labels):
                      # Classes 0,4,6,9: 0 labels, >=1 prediction.
                      for class_id in (0, 4, 6, 9):
                        self._test_precision_at_k(
                            predictions, labels, k=5, expected=0.0, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2422..2426

                Duplicated Code

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

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

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

                    for class_id in (0, 4, 6, 9):
                      self._test_precision_at_k(
                          predictions, labels, k=5, expected=0.0, class_id=class_id)
                      self._test_precision_at_top_k(
                          predictions_idx, labels, k=5, expected=0.0, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2311..2317

                Duplicated Code

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

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

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

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

                    predictions = constant_op.constant([
                        [[0, 0, 2, 1, 1, 0],
                         [0, 1, 2, 2, 0, 1]],
                        [[0, 0, 2, 1, 1, 1],
                         [1, 1, 2, 0, 0, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3890..3894
                tensorflow/python/kernel_tests/metrics_test.py on lines 3922..3926
                tensorflow/python/kernel_tests/metrics_test.py on lines 3927..3931

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 48.

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

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

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

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

                Refactorings

                Further Reading

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

                    labels = constant_op.constant([
                        [[0, 0, 1, 1, 0, 0],
                         [1, 0, 0, 0, 0, 1]],
                        [[1, 1, 1, 1, 1, 1],
                         [0, 0, 0, 0, 0, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3895..3899
                tensorflow/python/kernel_tests/metrics_test.py on lines 3922..3926
                tensorflow/python/kernel_tests/metrics_test.py on lines 3927..3931

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 48.

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

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

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

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

                Refactorings

                Further Reading

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

                    labels = constant_op.constant([
                        [[0, 0, 1, 1, 0, 0],
                         [1, 0, 0, 0, 0, 1]],
                        [[1, 1, 1, 1, 1, 1],
                         [0, 0, 0, 0, 0, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3890..3894
                tensorflow/python/kernel_tests/metrics_test.py on lines 3895..3899
                tensorflow/python/kernel_tests/metrics_test.py on lines 3927..3931

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 48.

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

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

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

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

                Refactorings

                Further Reading

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

                    predictions = constant_op.constant([
                        [[0, 0, 1, 1, 0, 0],
                         [1, 1, 0, 0, 1, 1]],
                        [[0, 0, 0, 1, 1, 1],
                         [1, 1, 1, 0, 0, 0]]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3890..3894
                tensorflow/python/kernel_tests/metrics_test.py on lines 3895..3899
                tensorflow/python/kernel_tests/metrics_test.py on lines 3922..3926

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 48.

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

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

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

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

                Refactorings

                Further Reading

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

                    with self.cached_session():
                      self.evaluate(variables.local_variables_initializer())
                      self.assertEqual(expected_error, self.evaluate(update_op))
                      self.assertEqual(expected_error, self.evaluate(error))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/checkpoint_utils_test.py on lines 88..91

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 46.

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

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

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

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

                Refactorings

                Further Reading

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

                      for class_id in (-1, 0, 1, 2, 4):
                        self._test_precision_at_k(
                            self._predictions, labels, k=1, expected=NAN, class_id=class_id)
                        self._test_precision_at_top_k(
                            self._predictions_idx, labels, k=1, expected=NAN, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2611..2615
                tensorflow/python/kernel_tests/metrics_test.py on lines 2736..2740

                Duplicated Code

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

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

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

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

                      for class_id in (-1, 0, 1, 4):
                        self._test_recall_at_k(
                            self._predictions, labels, k=1, expected=NAN, class_id=class_id)
                        self._test_recall_at_top_k(
                            self._predictions_idx, labels, k=1, expected=NAN, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2129..2133
                tensorflow/python/kernel_tests/metrics_test.py on lines 2736..2740

                Duplicated Code

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

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

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

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

                      for class_id in (0, 3, 4, 6, 9, 10):
                        self._test_recall_at_k(
                            self._predictions, labels, k=5, expected=NAN, class_id=class_id)
                        self._test_recall_at_top_k(
                            self._predictions_idx, labels, k=5, expected=NAN, class_id=class_id)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2129..2133
                tensorflow/python/kernel_tests/metrics_test.py on lines 2611..2615

                Duplicated Code

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

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

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

                    self._test_3d_weighted(
                        _test_values((3, 2, 4)),
                        weights=np.asarray((
                            5, 7, 11, 3, 2, 12, 7, 5, 2, 17, 11, 3,
                            2, 17, 11, 3, 5, 7, 11, 3, 2, 12, 7, 5)).reshape((3, 2, 4)))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/array_ops/weights_broadcast_test.py on lines 94..97

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 44.

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

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

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

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

                Refactorings

                Further Reading

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

                          1 / 3 * (7 / (7 + 3 + 7) + 5 / (5 + 4 + 5) + 0 / (0 + 5 + 0)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3937..3937

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 43.

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

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

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

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

                Refactorings

                Further Reading

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

                      self.assertAlmostEqual(1 / 2 * (9 / (9 + 3 + 5) + 7 / (7 + 5 + 3)),
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3906..3906

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 43.

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

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

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

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

                Refactorings

                Further Reading

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

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=1.0 / 2.0, class_id=7,
                        weights=[[1, 0], [1, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2944..2946

                Duplicated Code

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

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

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

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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=1.0 / 2.0,
                        class_id=7, weights=[[1, 0], [1, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2941..2943

                Duplicated Code

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

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

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

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

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=2.0 / 2.0, class_id=2,
                        weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=2.0 / 2.0,
                        class_id=2, weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=1.0 / 1.0,
                        class_id=7, weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=0.0 / 1.0, class_id=7,
                        weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=2.0 / 2.0, class_id=2,
                        weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=2.0 / 2.0,
                        class_id=2, weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=0.0 / 1.0,
                        class_id=7, weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2925..2927
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935

                Duplicated Code

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

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

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

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=1.0 / 1.0, class_id=7,
                        weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2909..2911
                tensorflow/python/kernel_tests/metrics_test.py on lines 2912..2914
                tensorflow/python/kernel_tests/metrics_test.py on lines 2917..2919
                tensorflow/python/kernel_tests/metrics_test.py on lines 2920..2922
                tensorflow/python/kernel_tests/metrics_test.py on lines 2928..2930
                tensorflow/python/kernel_tests/metrics_test.py on lines 2933..2935
                tensorflow/python/kernel_tests/metrics_test.py on lines 2936..2938

                Duplicated Code

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

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

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

                    labels = array_ops.concat([
                        constant_op.constant(0, shape=[3]), constant_op.constant(1, shape=[7])
                    ], 0)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 5 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3810..3816
                tensorflow/python/kernel_tests/metrics_test.py on lines 3817..3823
                tensorflow/python/kernel_tests/metrics_test.py on lines 3857..3863
                tensorflow/python/kernel_tests/metrics_test.py on lines 3864..3870
                tensorflow/python/kernel_tests/metrics_test.py on lines 4156..4158

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                    labels = array_ops.concat(
                        [
                            constant_op.constant(
                                0, shape=[3]), constant_op.constant(
                                    1, shape=[7])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 5 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3810..3816
                tensorflow/python/kernel_tests/metrics_test.py on lines 3857..3863
                tensorflow/python/kernel_tests/metrics_test.py on lines 3864..3870
                tensorflow/python/kernel_tests/metrics_test.py on lines 4156..4158
                tensorflow/python/kernel_tests/metrics_test.py on lines 4159..4161

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                    predictions = array_ops.concat([
                        constant_op.constant(0, shape=[5]), constant_op.constant(1, shape=[5])
                    ], 0)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 5 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3810..3816
                tensorflow/python/kernel_tests/metrics_test.py on lines 3817..3823
                tensorflow/python/kernel_tests/metrics_test.py on lines 3857..3863
                tensorflow/python/kernel_tests/metrics_test.py on lines 3864..3870
                tensorflow/python/kernel_tests/metrics_test.py on lines 4159..4161

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                    predictions = array_ops.concat(
                        [
                            constant_op.constant(
                                0, shape=[5]), constant_op.constant(
                                    1, shape=[5])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 5 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3810..3816
                tensorflow/python/kernel_tests/metrics_test.py on lines 3817..3823
                tensorflow/python/kernel_tests/metrics_test.py on lines 3864..3870
                tensorflow/python/kernel_tests/metrics_test.py on lines 4156..4158
                tensorflow/python/kernel_tests/metrics_test.py on lines 4159..4161

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                    labels = array_ops.concat(
                        [
                            constant_op.constant(
                                0, shape=[3]), constant_op.constant(
                                    1, shape=[7])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 5 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3810..3816
                tensorflow/python/kernel_tests/metrics_test.py on lines 3817..3823
                tensorflow/python/kernel_tests/metrics_test.py on lines 3857..3863
                tensorflow/python/kernel_tests/metrics_test.py on lines 4156..4158
                tensorflow/python/kernel_tests/metrics_test.py on lines 4159..4161

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                    predictions = array_ops.concat(
                        [
                            constant_op.constant(
                                0, shape=[5]), constant_op.constant(
                                    1, shape=[5])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 5 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3817..3823
                tensorflow/python/kernel_tests/metrics_test.py on lines 3857..3863
                tensorflow/python/kernel_tests/metrics_test.py on lines 3864..3870
                tensorflow/python/kernel_tests/metrics_test.py on lines 4156..4158
                tensorflow/python/kernel_tests/metrics_test.py on lines 4159..4161

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.mean(array_ops.ones([4, 3]))
                    _assert_metric_variables(self, ('mean/count:0', 'mean/total:0'))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 354..358

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 39.

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

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

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

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

                Refactorings

                Further Reading

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

                  @test_util.run_deprecated_v1
                  def testVars(self):
                    metrics.mean_tensor(array_ops.ones([4, 3]))
                    _assert_metric_variables(self,
                                             ('mean/total_tensor:0', 'mean/count_tensor:0'))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 174..177

                Duplicated Code

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

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

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

                    predictions_idx = [[[9, 4, 6, 2, 0], [5, 7, 2, 9, 6]],
                                       [[5, 7, 2, 9, 6], [9, 4, 6, 2, 0]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2396..2397
                tensorflow/python/kernel_tests/metrics_test.py on lines 2415..2416
                tensorflow/python/kernel_tests/metrics_test.py on lines 2470..2471

                Duplicated Code

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

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

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

                    predictions_idx = [[[9, 4, 6, 2, 0], [5, 7, 2, 9, 6]],
                                       [[5, 7, 2, 9, 6], [9, 4, 6, 2, 0]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2415..2416
                tensorflow/python/kernel_tests/metrics_test.py on lines 2434..2435
                tensorflow/python/kernel_tests/metrics_test.py on lines 2470..2471

                Duplicated Code

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

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

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

                    predictions_idx = [[[9, 4, 6, 2, 0], [5, 7, 2, 9, 6]],
                                       [[5, 7, 2, 9, 6], [9, 4, 6, 2, 0]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2396..2397
                tensorflow/python/kernel_tests/metrics_test.py on lines 2415..2416
                tensorflow/python/kernel_tests/metrics_test.py on lines 2434..2435

                Duplicated Code

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

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

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

                    predictions_idx = [[[9, 4, 6, 2, 0], [5, 7, 2, 9, 6]],
                                       [[5, 7, 2, 9, 6], [9, 4, 6, 2, 0]]]
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2396..2397
                tensorflow/python/kernel_tests/metrics_test.py on lines 2434..2435
                tensorflow/python/kernel_tests/metrics_test.py on lines 2470..2471

                Duplicated Code

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

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

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

                    precision, update_op = metrics.precision(
                        labels,
                        predictions,
                        weights=constant_op.constant([[1, 2, 3, 4], [4, 3, 2, 1]]))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 885..888

                Duplicated Code

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

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

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    precision, update_op = metrics.precision(
                        labels,
                        predictions,
                        weights=constant_op.constant([[1, 2, 3, 4], [4, 3, 2, 1]]))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 906..909

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                      _enqueue_vector(
                          sess,
                          values_queue, [[[1, 2], [1, 2]], [[3, 4], [9, 10]]],
                          shape=(2, 2, 2))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 397..400

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                      _enqueue_vector(
                          sess,
                          values_queue, [[[1, 2], [1, 2]], [[1, 2], [1, 2]]],
                          shape=(2, 2, 2))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 401..404

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    self._test_precision_at_top_k(
                        predictions_idx, labels, k=5, expected=1.0 / 2.0, class_id=7,
                        weights=[[0, 1], [1, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2517..2519

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    self._test_precision_at_k(
                        predictions, labels, k=5, expected=1.0 / 2.0, class_id=7,
                        weights=[[0, 1], [1, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2520..2522

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
                Open

                    feed_dict = {
                        predictions: ((1, 0, 1, 0), (1, 0, 1, 0)),
                        labels: ((0, 1, 1, 0), (1, 0, 0, 1))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 55 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 844..846
                tensorflow/python/kernel_tests/metrics_test.py on lines 902..904

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 37.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    feed_dict = {
                        predictions: ((1, 0, 1, 0), (1, 0, 1, 0)),
                        labels: ((0, 1, 1, 0), (1, 0, 0, 1))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 55 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 844..846
                tensorflow/python/kernel_tests/metrics_test.py on lines 864..866

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 37.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    feed_dict = {
                        predictions: ((1, 0, 1, 0), (1, 0, 1, 0)),
                        labels: ((0, 1, 1, 0), (1, 0, 0, 1))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 55 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 864..866
                tensorflow/python/kernel_tests/metrics_test.py on lines 902..904

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 37.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                      self.assertAllClose([[[1, 2], [1, 2]], [[2, 3], [5, 6]]],
                                          self.evaluate(mean))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 55 mins to fix
                tensorflow/python/kernel_tests/array_ops/stack_op_test.py on lines 354..355
                tensorflow/python/kernel_tests/distributions/categorical_test.py on lines 424..425

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 37.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_top_k(
                        predictions_idx, labels, k=5, expected=2.0 / 2.0, class_id=2,
                        weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_k(
                        predictions, labels, k=5, expected=1.0 / 1.0, class_id=7,
                        weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_k(
                        predictions, labels, k=5, expected=2.0 / 2.0, class_id=2,
                        weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_top_k(
                        predictions_idx, labels, k=5, expected=2.0 / 2.0, class_id=2,
                        weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_top_k(
                        predictions_idx, labels, k=5, expected=0.0 / 1.0, class_id=7,
                        weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_top_k(
                        predictions_idx, labels, k=5, expected=1.0 / 1.0, class_id=7,
                        weights=[[0], [1]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_k(
                        predictions, labels, k=5, expected=0.0 / 1.0, class_id=7,
                        weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2477..2479
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
                Open

                    self._test_precision_at_k(
                        predictions, labels, k=5, expected=2.0 / 2.0, class_id=2,
                        weights=[[1], [0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 7 other locations - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2480..2482
                tensorflow/python/kernel_tests/metrics_test.py on lines 2485..2487
                tensorflow/python/kernel_tests/metrics_test.py on lines 2488..2490
                tensorflow/python/kernel_tests/metrics_test.py on lines 2493..2495
                tensorflow/python/kernel_tests/metrics_test.py on lines 2496..2498
                tensorflow/python/kernel_tests/metrics_test.py on lines 2501..2503
                tensorflow/python/kernel_tests/metrics_test.py on lines 2504..2506

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=NAN, class_id=7,
                        weights=[[0, 1], [0, 1]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2952..2954

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=NAN, class_id=7,
                        weights=[[0, 1], [0, 1]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2949..2951

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                      self._test_recall_at_top_k(
                          self._predictions_idx, self._labels, k=5, expected=NAN,
                          class_id=class_id, weights=[[0, 0], [0, 0]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2888..2890

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                      self._test_recall_at_k(
                          self._predictions, self._labels, k=5, expected=NAN, class_id=class_id,
                          weights=[[0, 0], [0, 0]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 50 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2891..2893

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                          np.concatenate([[l] * int(w) for l, w in zip(labels, weights)]))
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 45 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3394..3394

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                  return (np.concatenate([[p] * int(w) for p, w in zip(predictions, weights)]),
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 45 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 3395..3395

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 3 locations. Consider refactoring.
                Open

                    sparse_labels = _binary_2d_label_to_2d_sparse_value(
                        [[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2307..2308
                tensorflow/python/kernel_tests/metrics_test.py on lines 2324..2325

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
                Open

                    sparse_labels = _binary_2d_label_to_2d_sparse_value(
                        [[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2290..2291
                tensorflow/python/kernel_tests/metrics_test.py on lines 2324..2325

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
                Open

                    sparse_labels = _binary_2d_label_to_2d_sparse_value(
                        [[0, 0, 1, 0, 0, 0, 0, 1, 1, 0], [0, 1, 1, 0, 0, 1, 0, 0, 0, 0]])
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2290..2291
                tensorflow/python/kernel_tests/metrics_test.py on lines 2307..2308

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    precision_ex2 = (0.0 / 1, 0.0 / 2, 1.0 / 3, 2.0 / 4)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2173..2173
                tensorflow/python/kernel_tests/metrics_test.py on lines 2247..2247

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    precision_ex1 = (0.0 / 1, 1.0 / 2, 1.0 / 3, 2.0 / 4)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2173..2173
                tensorflow/python/kernel_tests/metrics_test.py on lines 2191..2191

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                    precision_ex1 = (0.0 / 1, 1.0 / 2, 1.0 / 3, 2.0 / 4)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 2 other locations - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2191..2191
                tensorflow/python/kernel_tests/metrics_test.py on lines 2247..2247

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                      self._test_recall_at_k(
                          self._predictions, self._labels, k=5, expected=NAN, class_id=class_id,
                          weights=[[0], [0]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2885..2887

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                      self._test_recall_at_top_k(
                          self._predictions_idx, self._labels, k=5, expected=NAN,
                          class_id=class_id, weights=[[0], [0]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 40 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2882..2884

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    self._test_recall_at_k(
                        self._predictions, self._labels, k=5, expected=NAN,
                        weights=[[0, 0], [0, 0]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2902..2904

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    streaming_precision = [(ex1 + ex2) / 2
                                           for ex1, ex2 in zip(precision_ex1, precision_ex2)]
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2209..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 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

                    streaming_average_precision = [
                        (ex1 + ex2) / 2
                        for ex1, ex2 in zip(avg_precision_ex1, avg_precision_ex2)
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2207..2208

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

                    self._test_recall_at_top_k(
                        self._predictions_idx, self._labels, k=5, expected=NAN,
                        weights=[[0, 0], [0, 0]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2899..2901

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      weights = constant_op.constant(
                          [[0, 0], [1, 1]], shape=(2, 2), dtype=dtypes_lib.float32)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/tpu_strategy_model_parallelism_test.py on lines 533..534
                tensorflow/python/kernel_tests/metrics_test.py on lines 1841..1842
                tensorflow/python/kernel_tests/metrics_test.py on lines 1872..1873

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      predictions = constant_op.constant(
                          [[1, 0], [1, 0]], shape=(2, 2), dtype=dtypes_lib.float32)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/tpu_strategy_model_parallelism_test.py on lines 533..534
                tensorflow/python/kernel_tests/metrics_test.py on lines 1841..1842
                tensorflow/python/kernel_tests/metrics_test.py on lines 1875..1876

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    precision, update_op = metrics.precision(
                        labels, predictions, weights=constant_op.constant([[2], [5]]))
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 868..869

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      self._test_recall_at_k(
                          predictions, labels, k=1, expected=2.0 / 2, class_id=3,
                          weights=(2.0, 3.0))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2669..2671
                tensorflow/python/kernel_tests/metrics_test.py on lines 2672..2674
                tensorflow/python/kernel_tests/metrics_test.py on lines 2678..2680

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      self._test_recall_at_top_k(
                          predictions_idx, labels, k=1, expected=2.0 / 2, class_id=3,
                          weights=(2.0, 3.0))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2669..2671
                tensorflow/python/kernel_tests/metrics_test.py on lines 2672..2674
                tensorflow/python/kernel_tests/metrics_test.py on lines 2675..2677

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      self._test_recall_at_k(
                          predictions, labels, k=1, expected=1.0 / 1, class_id=3,
                          weights=(1.0, 0.0))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2672..2674
                tensorflow/python/kernel_tests/metrics_test.py on lines 2675..2677
                tensorflow/python/kernel_tests/metrics_test.py on lines 2678..2680

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    precision, update_op = metrics.precision(
                        labels, predictions, weights=constant_op.constant([[2], [5]]))
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 829..830

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      predictions = constant_op.constant(
                          [[1, 0], [1, 0]], shape=(2, 2), dtype=dtypes_lib.float32)
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/tpu_strategy_model_parallelism_test.py on lines 533..534
                tensorflow/python/kernel_tests/metrics_test.py on lines 1872..1873
                tensorflow/python/kernel_tests/metrics_test.py on lines 1875..1876

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    self._test_3d_weighted(
                        _test_values((3, 2, 4)),
                        weights=np.asarray((
                            5, 7, 11, 3, 2, 12, 7, 5, 2, 17, 11, 3)).reshape((3, 1, 4)))
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/kernel_tests/array_ops/weights_broadcast_test.py on lines 87..89

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      self._test_recall_at_top_k(
                          predictions_idx, labels, k=1, expected=1.0 / 1, class_id=3,
                          weights=(1.0, 0.0))
                Severity: Major
                Found in tensorflow/python/kernel_tests/metrics_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2669..2671
                tensorflow/python/kernel_tests/metrics_test.py on lines 2675..2677
                tensorflow/python/kernel_tests/metrics_test.py on lines 2678..2680

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    self._test_precision_at_k(
                        predictions, labels, k=5, expected=NAN, class_id=7,
                        weights=[[1, 0], [0, 1]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2512..2514

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    self._test_precision_at_top_k(
                        predictions_idx, labels, k=5, expected=NAN, class_id=7,
                        weights=[[1, 0], [0, 1]])
                Severity: Minor
                Found in tensorflow/python/kernel_tests/metrics_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/kernel_tests/metrics_test.py on lines 2509..2511

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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