tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/sparse_bincount_ops_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File sparse_bincount_ops_test.py has 706 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2023 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/ops/sparse_bincount_ops_test.py - About 1 day to fix

    Function test_sparse_input has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def test_sparse_input(self,
    Severity: Major
    Found in tensorflow/python/ops/sparse_bincount_ops_test.py - About 1 hr to fix

      Function test_dense_input has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def test_dense_input(self,
      Severity: Major
      Found in tensorflow/python/ops/sparse_bincount_ops_test.py - About 1 hr to fix

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

          def test_weights(
        Severity: Major
        Found in tensorflow/python/ops/sparse_bincount_ops_test.py - About 50 mins to fix

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

            def test_binary_output(
          Severity: Minor
          Found in tensorflow/python/ops/sparse_bincount_ops_test.py - About 45 mins to fix

            Function test_axis_neg_one has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def test_axis_neg_one(
            Severity: Minor
            Found in tensorflow/python/ops/sparse_bincount_ops_test.py - About 35 mins to fix

              Function test_default has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def test_default(
              Severity: Minor
              Found in tensorflow/python/ops/sparse_bincount_ops_test.py - About 35 mins to fix

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

                  @parameterized.product(
                      (
                          dict(
                              tid="_s1",
                              x_factory=_sparse_factory([1, 2, 2, 3, 3, 3]),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 1 day to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 232..299

                Duplicated Code

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

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

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

                      }, {
                          "testcase_name":
                              "_minlength_larger_values_weights",
                          "x":
                              np.array([[3, 0, 1, 0], [7, 0, 0, 0], [5, 0, 4, 4]],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 6 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 331..343

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 103.

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

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

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

                See codeclimate-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

                      }, {
                          "testcase_name":
                              "_minlength_weights",
                          "x":
                              np.array([[3, 0, 1, 0], [7, 0, 0, 0], [5, 0, 4, 4]],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 6 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 344..356

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 103.

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

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

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

                def _adjust_expected_rank1(x, minlength, maxlength):
                  """Trim or pad an expected result based on minlength and maxlength."""
                  n = len(x)
                  if (minlength is not None) and (n < minlength):
                    x = x + [0] * (minlength - n)
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 2 other locations - About 6 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 34..41
                tensorflow/python/ops/bincount_ops_test.py on lines 31..38

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 101.

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

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

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

                See codeclimate-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

                  @parameterized.named_parameters(
                      {
                          "testcase_name":
                              "_no_maxlength",
                          "x":
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 6 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 372..520

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 98.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name": "_minlength_larger_values_weights",
                          "x": np.array([[3, 2, 1, 7], [7, 0, 4, 4]], dtype=np.int32),
                          "minlength": 3,
                          "expected_indices": [[0, 1], [0, 2], [0, 3], [0, 7], [1, 0], [1, 4],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 5 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 133..141

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 95.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name": "_minlength_weights",
                          "x": np.array([[3, 2, 1, 7], [7, 0, 4, 4]], dtype=np.int32),
                          "minlength": 9,
                          "expected_indices": [[0, 1], [0, 2], [0, 3], [0, 7], [1, 0], [1, 4],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 5 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 142..150

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 95.

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

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

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

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

                Refactorings

                Further Reading

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

                          dict(minlength=None, maxlength=None),
                          dict(minlength=3, maxlength=None),
                          dict(minlength=5, maxlength=None),
                          dict(minlength=None, maxlength=3),
                          dict(minlength=None, maxlength=5),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 11 other locations - About 5 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 170..178
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 209..217
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 263..271
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 332..340
                tensorflow/python/ops/bincount_ops_test.py on lines 196..204
                tensorflow/python/ops/bincount_ops_test.py on lines 240..248
                tensorflow/python/ops/bincount_ops_test.py on lines 301..309
                tensorflow/python/ops/bincount_ops_test.py on lines 373..381
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 491..499
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 571..579
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 657..665

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 91.

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

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

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

                          dict(minlength=None, maxlength=None),
                          dict(minlength=3, maxlength=None),
                          dict(minlength=5, maxlength=None),
                          dict(minlength=None, maxlength=3),
                          dict(minlength=None, maxlength=5),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 11 other locations - About 5 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 170..178
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 209..217
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 263..271
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 332..340
                tensorflow/python/ops/bincount_ops_test.py on lines 196..204
                tensorflow/python/ops/bincount_ops_test.py on lines 240..248
                tensorflow/python/ops/bincount_ops_test.py on lines 301..309
                tensorflow/python/ops/bincount_ops_test.py on lines 373..381
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 444..452
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 571..579
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 657..665

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 91.

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

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

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

                          dict(minlength=None, maxlength=None),
                          dict(minlength=3, maxlength=None),
                          dict(minlength=5, maxlength=None),
                          dict(minlength=None, maxlength=3),
                          dict(minlength=None, maxlength=5),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 11 other locations - About 5 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 170..178
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 209..217
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 263..271
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 332..340
                tensorflow/python/ops/bincount_ops_test.py on lines 196..204
                tensorflow/python/ops/bincount_ops_test.py on lines 240..248
                tensorflow/python/ops/bincount_ops_test.py on lines 301..309
                tensorflow/python/ops/bincount_ops_test.py on lines 373..381
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 444..452
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 491..499
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 571..579

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 91.

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

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

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

                          dict(minlength=None, maxlength=None),
                          dict(minlength=3, maxlength=None),
                          dict(minlength=5, maxlength=None),
                          dict(minlength=None, maxlength=3),
                          dict(minlength=None, maxlength=5),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 11 other locations - About 5 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 170..178
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 209..217
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 263..271
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 332..340
                tensorflow/python/ops/bincount_ops_test.py on lines 196..204
                tensorflow/python/ops/bincount_ops_test.py on lines 240..248
                tensorflow/python/ops/bincount_ops_test.py on lines 301..309
                tensorflow/python/ops/bincount_ops_test.py on lines 373..381
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 444..452
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 491..499
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 657..665

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 91.

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

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

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

                See codeclimate-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

                      }, {
                          "testcase_name": "_minlength_binary",
                          "x": np.array([[3, 2, 1, 7], [7, 0, 4, 4]], dtype=np.int32),
                          "minlength": 9,
                          "expected_indices": [[0, 1], [0, 2], [0, 3], [0, 7], [1, 0], [1, 4],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 109..117

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 82.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name": "_minlength_larger_values_binary",
                          "x": np.array([[3, 2, 1, 7], [7, 0, 4, 4]], dtype=np.int32),
                          "minlength": 3,
                          "expected_indices": [[0, 1], [0, 2], [0, 3], [0, 7], [1, 0], [1, 4],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 100..108

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 82.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name": "_minlength",
                          "x": np.array([[3, 2, 1, 7], [7, 0, 4, 4]], dtype=np.int32),
                          "minlength": 9,
                          "expected_indices": [[0, 1], [0, 2], [0, 3], [0, 7], [1, 0], [1, 4],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 77..84

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 80.

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

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

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

                See codeclimate-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

                  @parameterized.product(
                      (
                          dict(
                              tid="_s1",
                              x_factory=_sparse_factory([1, 2, 2, 3, 3, 3]),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 156..193

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 80.

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

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

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

                See codeclimate-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

                      }, {
                          "testcase_name": "_minlength_larger_values",
                          "x": np.array([[3, 2, 1, 7], [7, 0, 4, 4]], dtype=np.int32),
                          "minlength": 3,
                          "expected_indices": [[0, 1], [0, 2], [0, 3], [0, 7], [1, 0], [1, 4],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 69..76

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 80.

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

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

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

                See codeclimate-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

                      }, {
                          "testcase_name":
                              "_minlength_binary",
                          "x":
                              np.array([[3, 0, 1, 0], [7, 0, 0, 0], [5, 0, 4, 4]],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 294..306

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name":
                              "_minlength_larger_values_binary",
                          "x":
                              np.array([[3, 0, 1, 0], [7, 0, 0, 0], [5, 0, 4, 4]],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 281..293

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 78.

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

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

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

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

                Refactorings

                Further Reading

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

                  @parameterized.product(
                      (
                          dict(
                              tid="_s1",
                              x_factory=_sparse_factory([1, 2, 2, 3, 3, 3]),
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 309..360

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 76.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name":
                              "_minlength",
                          "x":
                              np.array([[3, 0, 1, 0], [7, 0, 0, 0], [5, 0, 4, 4]],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 246..256

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 76.

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

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

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

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

                Refactorings

                Further Reading

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

                      }, {
                          "testcase_name":
                              "_minlength_larger_values",
                          "x":
                              np.array([[3, 0, 1, 0], [7, 0, 0, 0], [5, 0, 4, 4]],
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 4 hrs to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 235..245

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 76.

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

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

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

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

                Refactorings

                Further Reading

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

                  @parameterized.product(
                      (
                          dict(
                              tid="_s2",
                              x_factory=_sparse_factory(
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 199..226

                Duplicated Code

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

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

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

                    x = sparse_ops.from_dense(
                        np.array([[3, 0, 1, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 700..701
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 720..721
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 729..730
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 736..737
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 738..739
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 744..745

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    weights = sparse_ops.from_dense(
                        np.array([[3, 1, 0, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 700..701
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 720..721
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 727..728
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 736..737
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 738..739
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 744..745

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    x = sparse_ops.from_dense(
                        np.array([[3, 0, 1, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 700..701
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 720..721
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 727..728
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 729..730
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 738..739
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 744..745

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    weights = sparse_ops.from_dense(
                        np.array([[3, 0, 1, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 720..721
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 727..728
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 729..730
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 736..737
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 738..739
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 744..745

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    x = sparse_ops.from_dense(
                        np.array([[3, 0, 1, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 700..701
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 720..721
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 727..728
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 729..730
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 736..737
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 738..739

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    x = sparse_ops.from_dense(
                        np.array([[3, 0, 1, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 700..701
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 727..728
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 729..730
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 736..737
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 738..739
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 744..745

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    weights = sparse_ops.from_dense(
                        np.array([[3, 1, 1, 0], [0, 0, 0, 0], [5, 0, 4, 4]], dtype=np.int32))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 8 other locations - About 1 hr to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 531..532
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 545..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 700..701
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 720..721
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 727..728
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 729..730
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 736..737
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 744..745

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 42.

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

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

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

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

                Refactorings

                Further Reading

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

                    with self.assertRaisesRegex(errors.InvalidArgumentError,
                                                "must have the same indices"):
                      self.evaluate(sparse_ops.sparse_bincount(x, weights=weights, axis=-1))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 3 other locations - About 45 mins to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 553..555
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 711..714
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 749..751

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 35.

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

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

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

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

                Refactorings

                Further Reading

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

                    with self.assertRaisesRegex(errors.InvalidArgumentError,
                                                "must have the same dense shape"):
                      self.evaluate(sparse_ops.sparse_bincount(x, weights=weights, axis=-1))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 3 other locations - About 45 mins to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 553..555
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 711..714
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 731..733

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 35.

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

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

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

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

                Refactorings

                Further Reading

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

                    if context.executing_eagerly():
                      with self.assertRaisesRegex(errors.InvalidArgumentError,
                                                  "must have the same shape"):
                        self.evaluate(sparse_ops.sparse_bincount(x, weights=weights, axis=-1))
                    else:
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 6 other locations - About 35 mins to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 527..528
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 534..535
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 540..541
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 547..548
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 702..703
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 723..724

                Duplicated Code

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

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

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

                    with self.assertRaisesRegex(ValueError, "must be a tf.Tensor"):
                      self.evaluate(sparse_ops.sparse_bincount(x, weights=weights, axis=-1))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 6 other locations - About 35 mins to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 527..528
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 534..535
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 540..541
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 547..548
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 711..717
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 723..724

                Duplicated Code

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

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

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

                    with self.assertRaisesRegex(ValueError, "must be a SparseTensor"):
                      self.evaluate(sparse_ops.sparse_bincount(x, weights=weights, axis=-1))
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 6 other locations - About 35 mins to fix
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 527..528
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 534..535
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 540..541
                tensorflow/python/ops/ragged/ragged_bincount_ops_test.py on lines 547..548
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 702..703
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 711..717

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 33.

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

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

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

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

                Refactorings

                Further Reading

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

                          dict(
                              tid="_s3",
                              x_factory=_sparse_factory(
                                  [[[0, 0, 0], [0, 1, 0]], [[2, 0, 2], [3, 3, 3]]]
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 435..438
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 538..541
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 538..546

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 32.

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

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

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

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

                Refactorings

                Further Reading

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

                          dict(
                              tid="_s3",
                              x_factory=_sparse_factory(
                                  [[[0, 0, 0], [0, 1, 0]], [[2, 0, 2], [3, 3, 3]]]
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 435..438
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 538..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 639..642

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 32.

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

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

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

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

                Refactorings

                Further Reading

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

                          dict(
                              tid="_s3",
                              x_factory=_sparse_factory(
                                  [[[0, 0, 0], [0, 1, 0]], [[2, 0, 2], [3, 3, 3]]]
                Severity: Major
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 538..541
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 538..546
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 639..642

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 32.

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

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

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

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

                Refactorings

                Further Reading

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

                          dict(
                              tid="_s1",
                              x_factory=_sparse_factory([1, 2, 2, 3, 3, 3]),
                              expected=[0, 1, 1, 1],
                Severity: Minor
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 625..628

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 32.

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

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

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

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

                Refactorings

                Further Reading

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

                          dict(
                              tid="_s1_zeros",
                              x_factory=_sparse_factory([1, 0, 0, 3, 3, 3]),
                              expected=[0, 1, 0, 1],
                Severity: Minor
                Found in tensorflow/python/ops/sparse_bincount_ops_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/ops/sparse_bincount_ops_test.py on lines 619..622

                Duplicated Code

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

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

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