tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function configure_cluster has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def configure_cluster(worker_hosts=None, task_index=-1):
  """Set multi-worker cluster spec in TF_CONFIG environment variable.

  Args:
    worker_hosts: comma-separated list of worker ip:port pairs.
Severity: Minor
Found in official/common/distribute_utils.py - About 45 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 image_info_to_feature_dict has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def image_info_to_feature_dict(height, width, filename, image_id,
Severity: Minor
Found in official/vision/data/tfrecord_lib.py - About 45 mins to fix

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

      def test_binary_sliced_metric(
    Severity: Minor
    Found in official/recommendation/uplift/metrics/sliced_metric_test.py - About 45 mins to fix

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

        def __init__(
      Severity: Minor
      Found in official/recommendation/uplift/metrics/loss_metric.py - About 45 mins to fix

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

          def __init__(self,
        Severity: Minor
        Found in official/recommendation/data_pipeline.py - About 45 mins to fix

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

            def __init__(self,
          Severity: Minor
          Found in official/recommendation/ranking/data/data_pipeline_multi_hot.py - About 45 mins to fix

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

            def get_distribution_strategy(distribution_strategy="mirrored",
            Severity: Minor
            Found in official/common/distribute_utils.py - About 45 mins to fix

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

                def test_power_linear_lr_schedule(self, init_lr, power, linear_decay_fraction,
              Severity: Minor
              Found in official/modeling/optimization/lr_schedule_test.py - About 45 mins to fix

                Function _download_and_clean has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def _download_and_clean(dataset, data_dir):
                  """Download MovieLens dataset in a standard format.
                
                  This function downloads the specified MovieLens format and coerces it into a
                  standard format. The only difference between the ml-1m and ml-20m datasets
                Severity: Minor
                Found in official/recommendation/movielens.py - About 45 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 write_tf_record_dataset has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def write_tf_record_dataset(output_path, annotation_iterator,
                Severity: Minor
                Found in official/vision/data/tfrecord_lib.py - About 45 mins to fix

                  Function process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def process(self, element):
                      elem_list = element.split(args.csv_delimeter)
                      out_list = []
                      for i, val in enumerate(elem_list):
                        if i > 0 and i <= NUM_NUMERIC_FEATURES:
                  Severity: Minor
                  Found in official/recommendation/ranking/preprocessing/criteo_preprocess.py - About 45 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 assertLayerSavable has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def assertLayerSavable(
                  Severity: Minor
                  Found in official/recommendation/uplift/keras_test_case.py - About 45 mins to fix

                    Function get_inference_signatures has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def get_inference_signatures(self, function_keys: Dict[Text, Text]):
                        """Gets defined function signatures.
                    
                        Args:
                          function_keys: A dictionary with keys as the function to create signature
                    Severity: Minor
                    Found in official/vision/serving/export_base.py - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def __init__(self,
                    Severity: Minor
                    Found in official/recommendation/ranking/data/data_pipeline.py - About 45 mins to fix

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

                        def __init__(self,
                      Severity: Minor
                      Found in official/recommendation/ranking/task.py - About 45 mins to fix

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

                          def __init__(self,
                        Severity: Minor
                        Found in official/recommendation/ranking/common.py - About 45 mins to fix

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

                          def _get_estimator_spec_with_metrics(logits: tf.Tensor,
                          Severity: Minor
                          Found in official/recommendation/neumf_model.py - About 45 mins to fix

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

                              def __init__(self,
                            Severity: Minor
                            Found in official/recommendation/ranking/data/data_pipeline_multi_hot.py - About 45 mins to fix

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

                                def __init__(self,
                                             multi_task: multitask.MultiTask,
                                             multi_task_model: Union[tf_keras.Model,
                                                                     base_model.MultiTaskBaseModel],
                                             optimizer: tf.optimizers.Optimizer,
                              Severity: Minor
                              Found in official/modeling/multitask/base_trainer.py - About 45 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 test_metric_computes_correct_loss has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                def test_metric_computes_correct_loss(
                              Severity: Minor
                              Found in official/recommendation/uplift/metrics/poisson_metrics_test.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language