tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

      groundtruth_classes_with_background_list = [
          tf.pad(one_hot_encoding, [[0, 0], [1, 0]], mode='CONSTANT')
Severity: Minor
Found in research/object_detection/meta_architectures/ssd_meta_arch.py and 1 other location - About 35 mins to fix
research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1056..1058

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

          test_layer(
              query=query[:, i * causal_chunk_length:(i + 1) *
Severity: Minor
Found in official/nlp/modeling/layers/kernel_attention_test.py and 1 other location - About 35 mins to fix
official/nlp/modeling/layers/kernel_attention_test.py on lines 79..82

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

    def adversarial_loss():
      return adv_lib.adversarial_loss(self.tensors['cl_embedded'],
                                      self.tensors['cl_loss'],
                                      self.cl_loss_from_embedding)
Severity: Minor
Found in research/adversarial_text/graphs.py and 1 other location - About 35 mins to fix
research/adversarial_text/graphs.py on lines 563..566

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

        tf.tile(
            tf.contrib.layers.one_hot_encoding(
                tf.constant([i]), num_classes=w),
            [h, 1]) for i in range(w)
Severity: Minor
Found in research/attention_ocr/python/model_test.py and 1 other location - About 35 mins to fix
research/attention_ocr/python/model_test.py on lines 195..197

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

    expected_output = np.array([[1. + 0.j, 0. + 0.j], [0. + 2.j, 1. + 0.j]])
Severity: Minor
Found in research/delf/delf/python/whiten_test.py and 1 other location - About 35 mins to fix
research/object_detection/exporter_lib_tf2_test.py on lines 297..297

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

                          [[150 + 0.7, 150 + 0.6], [150 + 0.9, 150 + 0.0]])
Severity: Minor
Found in research/object_detection/exporter_lib_tf2_test.py and 1 other location - About 35 mins to fix
research/delf/delf/python/whiten_test.py on lines 56..56

Duplicated Code

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

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

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

Tuning

This issue has a mass of 33.

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

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

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

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

Refactorings

Further Reading

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

    new_episode_rewards = tf.concat(
        [episode_rewards[:1] + context_reward, episode_rewards[1:]], 0)
Severity: Minor
Found in research/efficient-hrl/train.py and 1 other location - About 35 mins to fix
research/efficient-hrl/train.py on lines 96..98

Duplicated Code

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

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

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

Avoid too many return statements within this function.
Open

    return '['
Severity: Major
Found in research/cvt_text/base/embeddings.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return ']'
    Severity: Major
    Found in research/cvt_text/base/embeddings.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return w.replace(r'\/', '/').replace(r'\*', '*')
      Severity: Major
      Found in research/cvt_text/base/embeddings.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return str(obj)
        Severity: Major
        Found in research/vid2depth/util.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return 'Empty tuple.'
          Severity: Major
          Found in research/vid2depth/util.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return 'Array with shape: %s, dtype: %s' % (obj.shape, obj.dtype)
            Severity: Major
            Found in research/vid2depth/util.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return net, end_points
              Severity: Major
              Found in research/slim/nets/nasnet/nasnet.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return net, end_points
                Severity: Major
                Found in research/slim/nets/s3dg.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return logits, end_points
                  Severity: Major
                  Found in research/slim/nets/nasnet/pnasnet.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return net, end_points
                    Severity: Major
                    Found in research/slim/nets/s3dg.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                return net, end_points
                      Severity: Major
                      Found in research/slim/nets/s3dg.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return net, end_points
                        Severity: Major
                        Found in research/slim/nets/s3dg.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                    return net, end_points
                          Severity: Major
                          Found in research/slim/nets/s3dg.py - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language