tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File sparse_cross_op_test.py has 956 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/sparse_ops/sparse_cross_op_test.py - About 2 days to fix

    SparseCrossOpTest has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SparseCrossOpTest(test.TestCase):
    
      @test_util.run_deprecated_v1
      def test_simple(self):
        """Tests a simple scenario."""
    Severity: Minor
    Found in tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py - About 2 hrs to fix

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

        def _sparse_tensor(self, data, batch_size=-1):
          """Generates a SparseTensor.
      
          Args:
            data: Should be a list of list of strings or int64. Each item of the outer
      Severity: Minor
      Found in tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def _sparse_tensor(self, data, batch_size=-1):
          """Generates a SparseTensor.
      
          Args:
            data: Should be a list of list of strings or int64. Each item of the outer
      Severity: Minor
      Found in tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def test_sep_ignored_in_hashed_out(self):
          sp_inp_1 = self._sparse_tensor(
              [['batch1-FC1-F1', 'batch1-FC1-F2', 'batch1-FC1-F3']])
          sp_inp_2 = self._sparse_tensor([['batch1-FC2-F1']])
          sp_inp_3 = self._sparse_tensor([['batch1-FC3-F1', 'batch1-FC3-F2']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 991..1022

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 274.

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

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

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

      See codeclimate-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_hashed_different_salt(self):
          sp_inp_1 = self._sparse_tensor(
              [['batch1-FC1-F1', 'batch1-FC1-F2', 'batch1-FC1-F3']])
          sp_inp_2 = self._sparse_tensor([['batch1-FC2-F1']])
          sp_inp_3 = self._sparse_tensor([['batch1-FC3-F1', 'batch1-FC3-F2']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 1024..1055

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 274.

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

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

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

      See codeclimate-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 _sparse_tensor(self, data, batch_size=-1):
          """Generates a SparseTensor.
      
          Args:
            data: Should be a list of list of strings or int64. Each item of the outer
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 427..454

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 219.

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

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

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

      See codeclimate-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 _sparse_tensor(self, data, batch_size=-1):
          """Generates a SparseTensor.
      
          Args:
            data: Should be a list of list of strings or int64. Each item of the outer
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 33..61

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 219.

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

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

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

      See codeclimate-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 test_sparse_sep(self):
          """Tests a simple scenario."""
          sp_inp_1 = self._sparse_tensor([['batch1-FC1-F1'],
                                          ['batch2-FC1-F1', 'batch2-FC1-F2']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 505..529

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 test_sparse(self):
          """Tests a simple scenario."""
          sp_inp_1 = self._sparse_tensor([['batch1-FC1-F1'],
                                          ['batch2-FC1-F1', 'batch2-FC1-F2']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 531..555

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 test_dense(self):
          """Tests only dense inputs."""
          dense_inp_1 = constant_op.constant([['batch1-FC1-F1', 'batch1-FC1-F2'],
                                              ['batch2-FC1-F1', 'batch2-FC1-F2']],
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 585..611

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 152.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def test_dense_sep(self):
          """Tests only dense inputs."""
          dense_inp_1 = constant_op.constant([['batch1-FC1-F1', 'batch1-FC1-F2'],
                                              ['batch2-FC1-F1', 'batch2-FC1-F2']],
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 557..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 152.

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

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

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

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

      Refactorings

      Further Reading

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

          with self.cached_session():
            out = self.evaluate(output)
            self.assertEqual(6, len(out.values))
            self.assertAllEqual([[0, i] for i in range(6)], out.indices)
            self.assertTrue(all(x < 1000 and x >= 0 for x in out.values))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 408..414

      Duplicated Code

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

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

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

          with self.cached_session():
            out = self.evaluate(op)
            self.assertEqual(6, len(out.values))
            self.assertAllEqual([[0, i] for i in range(6)], out.indices)
            self.assertTrue(all(x < 1000 and x >= 0 for x in out.values))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 983..989

      Duplicated Code

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

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

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

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

          for b in range(batch_size):
            col_out.append([
                'batch%d-FC1-F1_X_batch%d-FC2-F1_X_batch%d-FC3-F1' % (b, b, b),
                'batch%d-FC1-F1_X_batch%d-FC2-F1_X_batch%d-FC3-F2' % (b, b, b),
                'batch%d-FC1-F2_X_batch%d-FC2-F1_X_batch%d-FC3-F1' % (b, b, b),
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 266..273

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 86.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 b in range(batch_size):
            col_out.append([
                'batch%d-FC1-F1_X_batch%d-FC2-F1_X_batch%d-FC3-F1' % (b, b, b),
                'batch%d-FC1-F1_X_batch%d-FC2-F1_X_batch%d-FC3-F2' % (b, b, b),
                'batch%d-FC1-F2_X_batch%d-FC2-F1_X_batch%d-FC3-F1' % (b, b, b),
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 792..799

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 86.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 b in range(batch_size):
            col1.append(
                ['batch%d-FC1-F1' % b,
                 'batch%d-FC1-F2' % b,
                 'batch%d-FC1-F3' % b])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 253..257

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 82.

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

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

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

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

      Refactorings

      Further Reading

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

          for b in range(batch_size):
            col1.append(
                ['batch%d-FC1-F1' % b, 'batch%d-FC1-F2' % b, 'batch%d-FC1-F3' % b])
            col2.append(['batch%d-FC2-F1' % b])
            col3.append(['batch%d-FC3-F1' % b, 'batch%d-FC3-F2' % b])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 771..777

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 82.

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

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

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

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

      Refactorings

      Further Reading

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_hashed(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 892..900
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 909..917
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 972..980

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

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

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

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

      Refactorings

      Further Reading

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_hashed(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 892..900
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 909..917
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 928..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 68.

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

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

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

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

      Refactorings

      Further Reading

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

          inds_2, vals_2, shapes_2 = gen_sparse_ops.sparse_cross_hashed(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 892..900
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 928..936
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 972..980

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

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

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

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

      Refactorings

      Further Reading

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_hashed(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 909..917
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 928..936
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 972..980

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

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

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

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

      Refactorings

      Further Reading

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_v2(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 696..700
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 744..748
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 782..786
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 837..841
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 864..868

      Duplicated Code

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

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

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_v2(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 744..748
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 782..786
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 816..820
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 837..841
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 864..868

      Duplicated Code

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

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

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_v2(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 696..700
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 744..748
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 816..820
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 837..841
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 864..868

      Duplicated Code

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

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

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_v2(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 696..700
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 782..786
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 816..820
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 837..841
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 864..868

      Duplicated Code

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

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

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_v2(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 696..700
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 744..748
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 782..786
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 816..820
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 864..868

      Duplicated Code

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

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

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

          inds, vals, shapes = gen_sparse_ops.sparse_cross_v2(
              indices=[sp_inp_1.indices, sp_inp_2.indices, sp_inp_3.indices],
              values=[sp_inp_1.values, sp_inp_2.values, sp_inp_3.values],
              shapes=[
                  sp_inp_1.dense_shape, sp_inp_2.dense_shape, sp_inp_3.dense_shape
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 696..700
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 744..748
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 782..786
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 816..820
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 837..841

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 59.

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

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

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

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

      Refactorings

      Further Reading

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

        def _assert_sparse_tensor_empty(self, sp):
          self.assertEqual(0, sp.indices.size)
          self.assertEqual(0, sp.values.size)
          # TODO(zakaria): check if we can ignore the first dim of the shape.
          self.assertEqual(0, sp.dense_shape[1])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 416..420

      Duplicated Code

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

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

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

        def _assert_sparse_tensor_empty(self, sp):
          self.assertEqual(0, sp.indices.size)
          self.assertEqual(0, sp.values.size)
          # TODO(zakaria): check if we can ignore the first dim of the shape.
          self.assertEqual(0, sp.dense_shape[1])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 68..72

      Duplicated Code

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

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

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

          with session.Session():
            values = self.evaluate(cross_dense)
            self.assertTrue(numpy.not_equal(values[0], values[1]).all())
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 962..964

      Duplicated Code

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

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

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

          with session.Session():
            values = self.evaluate(cross_dense)
            self.assertTrue(numpy.not_equal(values[0], values[1]).all())
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 394..396

      Duplicated Code

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

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

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

        def _assert_sparse_tensor_equals(self, sp1, sp2):
          self.assertAllEqual(sp1.indices, sp2.indices)
          self.assertAllEqual(sp1.values, sp2.values)
          self.assertAllEqual(sp1.dense_shape, sp2.dense_shape)
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 422..425
      tensorflow/python/kernel_tests/sparse_ops/sparse_ops_test.py on lines 1177..1180

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 50.

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

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

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

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

      Refactorings

      Further Reading

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

        def _assert_sparse_tensor_equals(self, sp1, sp2):
          self.assertAllEqual(sp1.indices, sp2.indices)
          self.assertAllEqual(sp1.values, sp2.values)
          self.assertAllEqual(sp1.dense_shape, sp2.dense_shape)
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 63..66
      tensorflow/python/kernel_tests/sparse_ops/sparse_ops_test.py on lines 1177..1180

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 50.

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

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

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

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

      Refactorings

      Further Reading

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

          expected_out = self._sparse_tensor([[
              'batch1-FC1-F1_X_batch1-FC2-F1_X_batch1-FC3-F1',
              'batch1-FC1-F1_X_batch1-FC2-F1_X_batch1-FC3-F2',
              'batch1-FC1-F1_X_batch1-FC2-F1_X_batch1-FC3-F3',
              'batch1-FC1-F1_X_batch1-FC2-F2_X_batch1-FC3-F1',
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 194..221

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

          expected_out = self._sparse_tensor([[
              'batch1-FC1-F1_X_batch1-FC2-F1_X_batch1-FC3-F1',
              'batch1-FC1-F1_X_batch1-FC2-F1_X_batch1-FC3-F2',
              'batch1-FC1-F1_X_batch1-FC2-F1_X_batch1-FC3-F3',
              'batch1-FC1-F1_X_batch1-FC2-F2_X_batch1-FC3-F1',
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 704..731

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

          op = sparse_ops.sparse_cross_hashed(
              [
                  self._sparse_tensor(
                      [['batch1-FC1-F1', 'batch1-FC1-F2', 'batch1-FC1-F3']]),
                  self._sparse_tensor([['batch1-FC2-F1']]),
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 229..233

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

          op = sparse_ops.sparse_cross([
              self._sparse_tensor(
                  [['batch1-FC1-F1', 'batch1-FC1-F2', 'batch1-FC1-F3']]),
              self._sparse_tensor([['batch1-FC2-F1']]),
              self._sparse_tensor([['batch1-FC3-F1', 'batch1-FC3-F2']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 400..405

      Duplicated Code

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

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

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

          op = sparse_ops.sparse_cross_hashed([
              self._sparse_tensor([['batch1-FC1-F1']]),
              self._sparse_tensor([['batch1-FC2-F1']]),
              self._sparse_tensor([['batch1-FC3-F1']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 342..346
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 357..361
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 371..375

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          op = sparse_ops.sparse_cross_hashed(
              [
                  self._sparse_tensor([['batch1-FC1-F1']]),
                  self._sparse_tensor([['batch1-FC2-F1']]),
                  self._sparse_tensor([['batch1-FC3-F1']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 330..333
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 357..361
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 371..375

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          op = sparse_ops.sparse_cross_hashed(
              [
                  self._sparse_tensor([['batch1-FC1-F1']]),
                  self._sparse_tensor([['batch1-FC2-F1']]),
                  self._sparse_tensor([['batch1-FC3-F1']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 330..333
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 342..346
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 371..375

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

          op = sparse_ops.sparse_cross_hashed(
              [
                  self._sparse_tensor([['batch1-FC1-F1']]),
                  self._sparse_tensor([['batch1-FC2-F1']]),
                  self._sparse_tensor([['batch1-FC3-F1']])
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 330..333
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 342..346
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 357..361

      Duplicated Code

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

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

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

          with self.assertRaisesRegex((errors.InvalidArgumentError, ValueError),
                                      'Expected batch size'):
            self.evaluate(sparse_ops.sparse_cross([st1, st2]))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 495..497

      Duplicated Code

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

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

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

          with self.assertRaisesRegex((errors.InvalidArgumentError, ValueError),
                                      'Expected batch size'):
            self.evaluate(sparse_ops.sparse_cross([st1, dt]))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 498..500

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 34.

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

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

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

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

      Refactorings

      Further Reading

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

          with self.assertRaisesRegex((errors.InvalidArgumentError, ValueError),
                                      'Input values should be a vector'):
            self.evaluate(sparse_ops.sparse_cross([st2]))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 463..465
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 475..477

      Duplicated Code

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

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

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

          with self.assertRaisesRegex((errors.InvalidArgumentError, ValueError),
                                      'Input indices should be a matrix'):
            self.evaluate(sparse_ops.sparse_cross([st1]))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 469..471
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 475..477

      Duplicated Code

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

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

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

          with self.assertRaisesRegex((errors.InvalidArgumentError, ValueError),
                                      'Input shapes should be a vector'):
            self.evaluate(sparse_ops.sparse_cross([st3]))
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 463..465
      tensorflow/python/kernel_tests/sparse_ops/sparse_cross_op_test.py on lines 469..471

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status