tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

  def __init__(self,
Severity: Minor
Found in orbit/examples/single_task/single_task_evaluator.py - About 35 mins to fix

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

      def __init__(self,
    Severity: Minor
    Found in official/projects/qat/nlp/modeling/networks/span_labeling.py - About 35 mins to fix

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

        def grid_stitch_back(
      Severity: Minor
      Found in official/projects/maxvit/modeling/maxvit.py - About 35 mins to fix

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

        def build_qat_classification_model(
        Severity: Minor
        Found in official/projects/qat/vision/modeling/factory.py - About 35 mins to fix

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

            def __init__(self, backbone: tf_keras.Model, decoder: tf_keras.layers.Layer,
          Severity: Minor
          Found in official/projects/qat/vision/modeling/segmentation_model.py - About 35 mins to fix

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

              def _compute_attention(self,
            Severity: Minor
            Found in official/projects/qat/nlp/modeling/layers/multi_head_attention.py - About 35 mins to fix

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

                def __init__(self,
              Severity: Minor
              Found in official/projects/qat/vision/n_bit/configs.py - About 35 mins to fix

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

                  def test_builder(self,
                Severity: Minor
                Found in official/projects/qat/vision/modeling/factory_test.py - About 35 mins to fix

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

                          let duration = typeof $(this).data('backtothetop-duration') === "undefined" ? defaults.duration : $(this).data('backtothetop-duration');
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 39..39
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 40..40
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 41..41

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          let easing = typeof $(this).data('backtothetop-easing') === "undefined" ?  defaults.easing : $(this).data('backtothetop-easing');
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 38..38
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 40..40
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 41..41

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          let offset = typeof $(this).data('backtothetop-offset') === "undefined" ? defaults.offset : $(this).data('backtothetop-offset');
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 38..38
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 39..39
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 41..41

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          let hash = typeof $(this).data('backtothetop-hash') === "undefined" ? defaults.hash : $(this).data('backtothetop-hash');
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 38..38
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 39..39
                  official/projects/waste_identification_ml/circularnet-docs/themes/hugo-theme-techdoc/src/js/jquery.backtothetop/jquery.backtothetop.js on lines 40..40

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

                  Function log_weights has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def log_weights(self):
                      """Log backbone weights."""
                      logging.info('Logging backbone weights')
                      logging.info('------------------------')
                      for layer in self.layers:
                  Severity: Minor
                  Found in research/delf/delf/python/training/model/resnet50.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def __init__(self, config, pretrained_embeddings, tasks):
                      self._config = config
                      self._tasks = tasks
                  
                      self._global_step, self._optimizer = self._get_optimizer()
                  Severity: Minor
                  Found in research/cvt_text/model/multitask_model.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function cholesky has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def cholesky(matrix):
                    """Cholesky decomposition.
                  
                    Cholesky decomposition suitable for non-positive definite matrices: involves
                    adding a small value `alpha` on the matrix diagonal until the matrix
                  Severity: Minor
                  Found in research/delf/delf/python/whiten.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function multiply_by_eta_per_layer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def multiply_by_eta_per_layer(self, h_grads, eta):
                      # Modifies eta
                      res = []
                      eta_statistics = []
                      for (g, v) in h_grads:
                  Severity: Minor
                  Found in research/rebar/rebar.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function _get_results has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def _get_results(self):
                      correct, count = 0, 0
                      for example, preds in zip(self._examples, self._preds):
                        for y_true, y_pred in zip(example.labels, preds):
                          count += 1
                  Severity: Minor
                  Found in research/cvt_text/task_specific/word_level/tagging_scorers.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function _get_clean_train_image_files_and_labels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _get_clean_train_image_files_and_labels(csv_path, image_dir):
                    """Get image file paths, image ids and  labels for the clean training split.
                  
                    Args:
                      csv_path: path to the Google-landmark Dataset v2 CSV Data Sources files
                  Severity: Minor
                  Found in research/delf/delf/python/training/build_image_dataset.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function multiply_by_eta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def multiply_by_eta(self, h_grads, eta):
                      # Modifies eta
                      res = []
                      eta_statistics = []
                      for (g, v) in h_grads:
                  Severity: Minor
                  Found in research/rebar/rebar.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function __new__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def __new__(cls,
                                outputs_to_num_classes,
                                crop_size=None,
                                atrous_rates=None,
                                output_stride=8,
                  Severity: Minor
                  Found in research/deeplab/common.py - About 35 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language