tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function stateful_representative_dataset_generator has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def stateful_representative_dataset_generator(
Severity: Major
Found in official/projects/movinet/tools/quantize_movinet.py - About 1 hr to fix

    Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def __init__(self,
    Severity: Major
    Found in official/projects/perceiver/modeling/layers/decoder.py - About 1 hr to fix

      Function find_similar_masks has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def find_similar_masks(

        Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def __init__(
        Severity: Major
        Found in official/projects/maxvit/modeling/layers.py - About 1 hr to fix

          Function save_to_tfrecord has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def save_to_tfrecord(input_frame: tf.Tensor,
          Severity: Major
          Found in official/projects/movinet/tools/quantize_movinet.py - About 1 hr to fix

            Function test_maybedwinvertedbottleneck_block_backward_pass_no_nans has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def test_maybedwinvertedbottleneck_block_backward_pass_no_nans(
            Severity: Major
            Found in official/projects/qat/vision/modeling/layers/nn_blocks_test.py - About 1 hr to fix

              Function test_maybedwinvertedbottleneck_block_forward_pass_no_nans has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def test_maybedwinvertedbottleneck_block_forward_pass_no_nans(
              Severity: Major
              Found in official/projects/qat/vision/modeling/layers/nn_blocks_test.py - About 1 hr to fix

                Function test_maybedwinvertedbottleneck_block_creation has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def test_maybedwinvertedbottleneck_block_creation(
                Severity: Major
                Found in official/projects/qat/vision/modeling/layers/nn_blocks_test.py - About 1 hr to fix

                  Function _concat_with_global_key_attn_probs has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def _concat_with_global_key_attn_probs(
                  Severity: Major
                  Found in official/projects/longformer/longformer_attention.py - About 1 hr to fix

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

                        image = np.fromstring(fig.canvas.tostring_rgb(), dtype='uint8').reshape(
                            1, int(height), int(width), 3)
                    Severity: Major
                    Found in research/object_detection/utils/visualization_utils.py and 3 other locations - About 1 hr to fix
                    research/cognitive_planning/visualization_utils.py on lines 700..701
                    research/cognitive_planning/visualization_utils.py on lines 728..730
                    research/object_detection/utils/visualization_utils.py on lines 1332..1334

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        image = np.fromstring(fig.canvas.tostring_rgb(), dtype='uint8').reshape(
                            1, int(height), int(width), 3)
                    Severity: Major
                    Found in research/cognitive_planning/visualization_utils.py and 3 other locations - About 1 hr to fix
                    research/cognitive_planning/visualization_utils.py on lines 728..730
                    research/object_detection/utils/visualization_utils.py on lines 1304..1305
                    research/object_detection/utils/visualization_utils.py on lines 1332..1334

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        image = np.fromstring(
                            fig.canvas.tostring_rgb(), dtype='uint8').reshape(
                                1, int(height), int(width), 3)
                    Severity: Major
                    Found in research/cognitive_planning/visualization_utils.py and 3 other locations - About 1 hr to fix
                    research/cognitive_planning/visualization_utils.py on lines 700..701
                    research/object_detection/utils/visualization_utils.py on lines 1304..1305
                    research/object_detection/utils/visualization_utils.py on lines 1332..1334

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        image = np.fromstring(
                            fig.canvas.tostring_rgb(), dtype='uint8').reshape(
                                1, int(height), int(width), 3)
                    Severity: Major
                    Found in research/object_detection/utils/visualization_utils.py and 3 other locations - About 1 hr to fix
                    research/cognitive_planning/visualization_utils.py on lines 700..701
                    research/cognitive_planning/visualization_utils.py on lines 728..730
                    research/object_detection/utils/visualization_utils.py on lines 1304..1305

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                      @parameterized.named_parameters([
                          ('padded_decode_true_with_name', True, 0.0, 'decoding'),
                          ('padded_decode_false_with_name', False, 0.0, 'decoding'),
                          ('padded_decode_true_without_name', True, 0.0, None),
                          ('padded_decode_false_without_name', False, 0.0, None),
                    Severity: Major
                    Found in official/nlp/modeling/ops/beam_search_test.py and 2 other locations - About 1 hr to fix
                    official/nlp/modeling/ops/beam_search_test.py on lines 62..67
                    official/nlp/modeling/ops/beam_search_test.py on lines 153..158

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        np.testing.assert_array_equal(
                            indices,
                            [[0, 10, 10], [0, 15, 5], [1, 11, 10], [2, 10, 10], [2, 7, 11]])
                    Severity: Major
                    Found in research/object_detection/core/target_assigner_test.py and 2 other locations - About 1 hr to fix
                    research/object_detection/core/target_assigner_test.py on lines 2653..2655
                    research/object_detection/core/target_assigner_test.py on lines 2696..2698

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        np.testing.assert_array_equal(
                            indices,
                            [[0, 10, 10], [0, 15, 5], [1, 11, 10], [2, 10, 10], [2, 7, 11]])
                    Severity: Major
                    Found in research/object_detection/core/target_assigner_test.py and 2 other locations - About 1 hr to fix
                    research/object_detection/core/target_assigner_test.py on lines 1581..1583
                    research/object_detection/core/target_assigner_test.py on lines 2696..2698

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          mask_predictions_logits = 20 * tf.ones((batch_size *
                                                                  model.max_num_proposals,
                                                                  model.num_classes,
                                                                  14, 14),
                                                                 dtype=tf.float32)
                    research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1569..1573
                    research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1673..1677

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          for v in slim.get_variables():
                            self.assertDeviceEqual(v.device, 'CPU:0')
                            self.assertDeviceEqual(v.value().device, 'CPU:0')
                    Severity: Major
                    Found in research/slim/deployment/model_deploy_test.py and 2 other locations - About 1 hr to fix
                    research/slim/deployment/model_deploy_test.py on lines 198..200
                    research/slim/deployment/model_deploy_test.py on lines 250..252

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        mlm_decoder = positional_decoder.PositionalDecoder(
                            decoder=decoder_,
                            output_index_dim=decoder_cfg.output_index_dim,
                            z_index_dim=decoder_cfg.z_index_dim,
                            d_latents=decoder_cfg.d_latents,
                    Severity: Major
                    Found in official/projects/perceiver/tasks/pretrain.py and 6 other locations - About 1 hr to fix
                    official/projects/perceiver/modeling/models/classifier_test.py on lines 60..66
                    official/projects/perceiver/modeling/models/classifier_test.py on lines 122..128
                    official/projects/perceiver/modeling/models/classifier_test.py on lines 184..190
                    official/projects/perceiver/modeling/models/pretrainer_test.py on lines 65..71
                    official/projects/perceiver/modeling/models/pretrainer_test.py on lines 140..146
                    official/projects/perceiver/tasks/sentence_prediction.py on lines 43..49

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        np.testing.assert_array_equal(
                            indices,
                            [[0, 10, 10], [0, 15, 5], [1, 11, 10], [2, 10, 10], [2, 7, 11]])
                    Severity: Major
                    Found in research/object_detection/core/target_assigner_test.py and 2 other locations - About 1 hr to fix
                    research/object_detection/core/target_assigner_test.py on lines 1581..1583
                    research/object_detection/core/target_assigner_test.py on lines 2653..2655

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 38.

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

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

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

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

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language