tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

def critic_net(states, actions,
               for_critic_loss=False,
               num_reward_dims=1,
               states_hidden_layers=(400,),
               actions_hidden_layers=None,
Severity: Minor
Found in research/efficient-hrl/agents/ddpg_networks.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 evaluate_checkpoint_repeatedly has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def evaluate_checkpoint_repeatedly(checkpoint_dir,
                                   evaluate_checkpoint_fn,
                                   eval_interval_secs=600,
                                   max_number_of_evaluations=None,
                                   checkpoint_timeout=None,
Severity: Minor
Found in research/efficient-hrl/utils/eval_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 compute_rewards has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def compute_rewards(self, mode, states, actions, rewards, next_states,
Severity: Minor
Found in research/efficient-hrl/context/context.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                for image_id in data[world]:
                  self._eval_init_points.append((world, image_id[0], goal))
            logging.info('loaded %d eval init points', len(self._eval_init_points))
    Severity: Major
    Found in research/cognitive_planning/envs/active_vision_dataset_env.py - About 45 mins to fix

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

      def false_fn(agent, state, action, transition_type, environment_steps,
      Severity: Minor
      Found in research/efficient-hrl/cond_fn.py - About 45 mins to fix

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

          def _compute_kp_heatmap_loss(self, input_height, input_width, task_name,
        Severity: Minor
        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

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

          def compute_spectrogram_feature(samples, sample_rate, stride_ms=10.0,
          Severity: Minor
          Found in research/deep_speech/data/featurizer.py - About 45 mins to fix

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

            def relative_context_multi_transition_fn(
            Severity: Minor
            Found in research/efficient-hrl/context/context_transition_functions.py - About 45 mins to fix

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

                def reset(self, mode, agent=None, action_fn=None, state=None):
                  """Returns ops that reset the context.
              
                  Args:
                    mode: a string representing the mode=[train, explore, eval].
              Severity: Minor
              Found in research/efficient-hrl/context/context.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 prediction_tensors_to_keypoint_candidates has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def prediction_tensors_to_keypoint_candidates(keypoint_heatmap_predictions,
              Severity: Minor
              Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

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

                def _score_to_distance_map(y_grid, x_grid, heatmap, points_y, points_x,
                Severity: Minor
                Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

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

                  def env_restart(agent, state, action, transition_type, environment_steps,
                  Severity: Minor
                  Found in research/efficient-hrl/cond_fn.py - About 45 mins to fix

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

                    def true_fn(agent, state, action, transition_type, environment_steps,
                    Severity: Minor
                    Found in research/efficient-hrl/cond_fn.py - About 45 mins to fix

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

                      def action_embed_net(
                          actions,
                          states=None,
                          num_output_dims=2,
                          hidden_layers=(400, 300),
                      Severity: Minor
                      Found in research/efficient-hrl/agent.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 timer_context_fn has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def timer_context_fn(contexts,
                      Severity: Minor
                      Found in research/efficient-hrl/context/context_transition_functions.py - About 45 mins to fix

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

                        def prediction_to_single_instance_keypoints(
                        Severity: Minor
                        Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix

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

                            def __init__(self, num_rnn_layers, rnn_type, is_bidirectional,
                          Severity: Minor
                          Found in research/deep_speech/deep_speech_model.py - About 45 mins to fix

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

                              def __init__(self,
                                           is_training,
                                           num_classes,
                                           image_resizer_fn,
                                           feature_extractor,
                            Severity: Minor
                            Found in research/object_detection/meta_architectures/faster_rcnn_meta_arch.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 continuous_eval_generator has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def continuous_eval_generator(estimator,
                            Severity: Minor
                            Found in research/object_detection/model_lib.py - About 45 mins to fix

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

                                def _scatter_keypoints_to_batch(self, num_ind, kpt_coords_for_example,
                              Severity: Minor
                              Found in research/object_detection/meta_architectures/center_net_meta_arch.py - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language