tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File ctc_loss_op_test.py has 966 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/nn_ops/ctc_loss_op_test.py - About 2 days to fix

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

    class CTCLossTestV2(test.TestCase, parameterized.TestCase):
    
      @test_util.run_in_graph_and_eager_modes
      def testCtcLossV2(self):
        random_seed.set_random_seed(5)
    Severity: Minor
    Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py - About 2 hrs to fix

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

      def _ctc_loss_v2(labels, inputs, sequence_length,
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py - About 50 mins to fix

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

          def _testCTCLoss(self,
        Severity: Minor
        Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py - About 45 mins to fix

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

          def _ctc_loss_v3(labels, logits, label_length, logit_length, use_gpu,
          Severity: Minor
          Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py - About 45 mins to fix

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

              def _genInputParams(self,
            Severity: Minor
            Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py - About 45 mins to fix

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

                  self.assertAllClose(blank, [
                      [0.16 + 0.17 + 0.18 + 0.19 + 0.20,
                       0.26 + 0.27 + 0.28 + 0.29 + 0.30],
                      [1.6 + 1.7 + 1.8 + 1.9 + 2.0,
                       2.6 + 2.7 + 2.8 + 2.9 + 3.0],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 day to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 869..875

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 167.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.assertAllClose(blank, [
                      [0.16 + 0.17 + 0.18 + 0.19 + 0.20,
                       0.26 + 0.27 + 0.28 + 0.29 + 0.30],
                      [1.6 + 1.7 + 1.8 + 1.9 + 2.0,
                       2.6 + 2.7 + 2.8 + 2.9 + 3.0],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 day to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 830..836

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 167.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.assertAllClose(olabel[:, :, 1:], [
                      [[0.0, 0.0, 0.12 + 0.14, 0.13 + 0.15, 0.0, 0.0, 0.0],
                       [0.22 + 0.23 + 0.24, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]],
                      [[0.0, 0.0, 1.2 + 1.4, 1.3 + 1.5, 0.0, 0.0, 0.0],
                       [2.2 + 2.3 + 2.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 day to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 838..844

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 153.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.assertAllClose(olabel[:, :, 1:], [
                      [[0.0, 0.0, 0.12 + 0.14, 0.13 + 0.15, 0.0, 0.0, 0.0],
                       [0.22 + 0.23 + 0.24, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]],
                      [[0.0, 0.0, 1.2 + 1.4, 1.3 + 1.5, 0.0, 0.0, 0.0],
                       [2.2 + 2.3 + 2.4, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 day to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 876..882

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 153.

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

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

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

                  states = [
                      [[0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20],
                       [0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30]],
                      [[1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0],
                       [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0]],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 855..861

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 84.

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

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

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

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

              Refactorings

              Further Reading

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

                  states = [
                      [[0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20],
                       [0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30]],
                      [[1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0],
                       [2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0]],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 4 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 817..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 84.

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

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

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

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

              Refactorings

              Further Reading

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

                    with self.cached_session() as sess:
                      for _ in range(32):
                        self.assertAllClose(*self.evaluate([ctc_loss, tf_nn_ctc_loss]))
                        self.assertAllClose(
                            *self.evaluate([ctc_loss_grads, tf_nn_ctc_grads]),
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 3 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 521..525
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 579..583
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 628..632

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 63.

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

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

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

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

              Refactorings

              Further Reading

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

                  with self.cached_session() as sess:
                    for _ in range(32):
                      self.assertAllClose(*self.evaluate([ctc_loss, tf_nn_ctc_loss]))
                      self.assertAllClose(
                          *self.evaluate([ctc_loss_grads, tf_nn_ctc_grads]),
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 3 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 404..408
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 521..525
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 628..632

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 63.

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

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

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

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

              Refactorings

              Further Reading

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

                  with self.cached_session() as sess:
                    for _ in range(32):
                      self.assertAllClose(*self.evaluate([ctc_loss, tf_nn_ctc_loss]))
                      self.assertAllClose(
                          *self.evaluate([ctc_loss_grads, tf_nn_ctc_grads]),
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 3 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 404..408
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 579..583
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 628..632

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 63.

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

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

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

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

              Refactorings

              Further Reading

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

                    with self.cached_session() as sess:
                      for _ in range(32):
                        self.assertAllClose(*self.evaluate([ctc_loss, tf_nn_ctc_loss]))
                        self.assertAllClose(
                            *self.evaluate([ctc_loss_grads, tf_nn_ctc_grads]),
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 3 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 404..408
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 521..525
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 579..583

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 63.

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

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

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

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

              Refactorings

              Further Reading

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

                  gradient_log_prob_1 = np.asarray(
                      [[-0.69824, 0.28562, 0.0831517, 0.0862751, 0.0816851, 0.161508],
                       [0.24082, -0.602467, 0.0557226, 0.0546814, 0.0557528, 0.19549],
                       [0.230246, 0.450868, 0.0389607, 0.038309, 0.0391602, -0.797544],
                       [0.280884, -0.570478, 0.0326593, 0.0339046, 0.0326856, 0.190345],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 2 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 179..185
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 187..193
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 200..206

              Duplicated Code

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

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

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

                  gradient_log_prob_0 = np.asarray(
                      [[-0.366234, 0.221185, 0.0917319, 0.0129757, 0.0142857, 0.0260553],
                       [0.111121, -0.411608, 0.278779, 0.0055756, 0.00569609, 0.010436],
                       [0.0357786, 0.633813, -0.678582, 0.00249248, 0.00272882, 0.0037688],
                       [0.0663296, -0.356151, 0.280111, 0.00283995, 0.0035545, 0.00331533],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 2 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 179..185
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 200..206
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 208..214

              Duplicated Code

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

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

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

                  input_prob_matrix_1 = np.asarray(
                      [[0.30176, 0.28562, 0.0831517, 0.0862751, 0.0816851, 0.161508],
                       [0.24082, 0.397533, 0.0557226, 0.0546814, 0.0557528, 0.19549],
                       [0.230246, 0.450868, 0.0389607, 0.038309, 0.0391602, 0.202456],
                       [0.280884, 0.429522, 0.0326593, 0.0339046, 0.0326856, 0.190345],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 2 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 179..185
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 187..193
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 208..214

              Duplicated Code

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

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

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

                  input_prob_matrix_0 = np.asarray(
                      [[0.633766, 0.221185, 0.0917319, 0.0129757, 0.0142857, 0.0260553],
                       [0.111121, 0.588392, 0.278779, 0.0055756, 0.00569609, 0.010436],
                       [0.0357786, 0.633813, 0.321418, 0.00249248, 0.00272882, 0.0037688],
                       [0.0663296, 0.643849, 0.280111, 0.00283995, 0.0035545, 0.00331533],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 3 other locations - About 2 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 187..193
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 200..206
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 208..214

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 58.

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

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

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

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

              Refactorings

              Further Reading

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

                  shifted_logits = array_ops.concat([
                      logits[:, :, :blank_index],
                      logits[:, :, -1:],
                      logits[:, :, blank_index:-1],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_decoder_ops_test.py on lines 172..173
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 563..566

              Duplicated Code

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

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

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

                  shifted_logits = array_ops.concat([
                      logits[:, :, :blank_index],
                      logits[:, :, -1:],
                      logits[:, :, blank_index:-1],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_decoder_ops_test.py on lines 172..173
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 503..506

              Duplicated Code

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

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

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

                for batch_i, batch in enumerate(x):
                  for time, val in enumerate(batch):
                    x_ix.append([batch_i, time])
                    x_val.append(val)
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/ops/ragged/ragged_cross_op_test.py on lines 43..46

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 47.

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

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

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

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

              Refactorings

              Further Reading

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

                  collapsed, new_seq_lengths = ctc_ops.collapse_repeated(
                      labels=[[1, 1, 1, 2, 2],
                              [1, 1, 1, 2, 2],
                              [1, 1, 1, 2, 2]],
                      seq_length=[5, 4, 3])
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 688..692
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 744..748

              Duplicated Code

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

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

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

                  collapsed, new_seq_lengths = ctc_ops.collapse_repeated(
                      labels=[[1, 3, 3, 3, 0],
                              [1, 4, 4, 4, 0],
                              [4, 2, 2, 9, 4]],
                      seq_length=[4, 5, 5])
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 731..735
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 744..748

              Duplicated Code

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

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

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

                  collapsed, new_seq_lengths = ctc_ops.collapse_repeated(
                      labels=[[1, 1, 1, 1, 1],
                              [1, 1, 1, 1, 1],
                              [1, 1, 1, 1, 1]],
                      seq_length=[4, 5, 1])
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 688..692
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 731..735

              Duplicated Code

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

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

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

                    tf_nn_ctc_logits = array_ops.concat([
                        logits[:, :, 1:],
                        logits[:, :, 0:1],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 443..445

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                  tf_nn_ctc_logits = array_ops.concat([
                      logits[:, :, 1:],
                      logits[:, :, 0:1],
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 389..391

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                  grad_truth = [
                      np.vstack([gradient_log_prob_0[t, :], gradient_log_prob_1[t, :]])
                      for t in range(5)
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 217..220

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                    out = ctc_ops._scan(
                        lambda a, e: a + e,
                        constant_op.constant([1.0, 2.0, 3.0]), 23.0,
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 934..936

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                  inputs = [
                      np.vstack(
                          [input_log_prob_matrix_0[t, :], input_log_prob_matrix_1[t, :]])
                      for t in range(5)
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 236..238

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                    out = ctc_ops._scan(
                        lambda a, e: a + e,
                        constant_op.constant([1.0, 2.0, 3.0]), 23.0,
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 928..930

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                  self.assertAllClose([
                      [[4.0, 6.0, 0.0, 0.0],
                       [18.0, 8.0, 0.0, 0.0]],
                      [[0.4, 0.6, 0.0, 0.0],
                       [1.8, 0.8, 0.0, 0.0]]
              Severity: Major
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 1 other location - About 1 hr to fix
              tensorflow/python/kernel_tests/signal/shape_ops_test.py on lines 281..282

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 39.

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

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

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

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

              Refactorings

              Further Reading

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

                  labels = random_ops.random_uniform(
                      [batch_size, label_length], minval=0, maxval=num_labels-1,
                      dtype=dtypes.int64)
              Severity: Minor
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 30 mins to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 475..478
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 597..599

              Duplicated Code

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

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

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

                  labels = random_ops.random_uniform([batch_size, label_length],
                                                     minval=0,
                                                     maxval=num_labels - 1,
                                                     dtype=dtypes.int64)
              Severity: Minor
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 30 mins to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 538..540
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 597..599

              Duplicated Code

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

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

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

                    labels = random_ops.random_uniform(
                        [batch_size, label_length], minval=0, maxval=num_labels-1,
                        dtype=dtypes.int64)
              Severity: Minor
              Found in tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py and 2 other locations - About 30 mins to fix
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 475..478
              tensorflow/python/kernel_tests/nn_ops/ctc_loss_op_test.py on lines 538..540

              Duplicated Code

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

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

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