tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

  def run_epoch(self, datasets, ops_to_eval, kind="train", batch_size=None,
Severity: Minor
Found in research/lfads/lfads.py - About 45 mins to fix

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

    def documents(dataset='train',
                  include_unlabeled=False,
                  include_validation=False):
      """Generates Documents based on FLAGS.dataset.
    
    
    Severity: Minor
    Found in research/adversarial_text/data/document_generators.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 decode_beam_search has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def decode_beam_search(self,
    Severity: Minor
    Found in research/seq_flow_lite/models/transformer_uniform_attn_decoder.py - About 45 mins to fix

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

      def select_inputs(decoder_inputs, action, local_step, is_training, is_quantized,
      Severity: Minor
      Found in research/lstm_object_detection/lstm/rnn_decoder.py - About 45 mins to fix

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

        def conv2d(inputs,
        Severity: Minor
        Found in research/autoaugment/custom_ops.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if content.startswith('review/text'):
                      yield Document(
                          content=content,
                          is_validation=False,
                          is_test=False,
          Severity: Major
          Found in research/adversarial_text/data/document_generators.py - About 45 mins to fix

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

              def write_model_samples(self, dataset_name, output_fname=None):
                """Use the prior distribution to generate batch_size number of samples
                from the model.
            
                LFADS generates a number of outputs for each sample, and these are all
            Severity: Minor
            Found in research/lfads/lfads.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 plot_time_series has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def plot_time_series(vals_bxtxn, bidx=None, n_to_plot=np.inf, scale=1.0,
            Severity: Minor
            Found in research/lfads/plot_lfads.py - About 45 mins to fix

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

              def _shake_shake_branch(x, output_filters, stride, rand_forward, rand_backward,
              Severity: Minor
              Found in research/autoaugment/shake_shake.py - About 45 mins to fix

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

                def _summarize_vars_and_grads(grads_and_vars):
                  tf.logging.info('Trainable variables:')
                  tf.logging.info('-' * 60)
                  for grad, var in grads_and_vars:
                    tf.logging.info(var)
                Severity: Minor
                Found in research/adversarial_text/layers.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 build has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def build(input_reader_config,
                Severity: Minor
                Found in research/lstm_object_detection/inputs/seq_dataset_builder.py - About 45 mins to fix

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

                    def __init__(self,
                  Severity: Minor
                  Found in research/adversarial_text/layers.py - About 45 mins to fix

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

                    def generate_rnn(rng, N, g, tau, dt, max_firing_rate):
                    Severity: Minor
                    Found in research/lfads/synth_data/synthetic_data_utils.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if (is_test and dataset != 'test') or (is_validation and
                                                                       not include_validation):
                                  continue
                      
                      
                      Severity: Major
                      Found in research/adversarial_text/data/document_generators.py - About 45 mins to fix

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

                          def _lm_loss(self,
                        Severity: Minor
                        Found in research/adversarial_text/graphs.py - About 45 mins to fix

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

                            def __init__(self,
                          Severity: Minor
                          Found in research/attention_ocr/python/model.py - About 45 mins to fix

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

                            def run_synthetic(main,
                            Severity: Minor
                            Found in official/utils/testing/integration.py - About 45 mins to fix

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

                              def main(_):
                                runner_config = load_runner_config()
                              
                                if FLAGS.output_dir:
                                  tf.gfile.MakeDirs(FLAGS.output_dir)
                              Severity: Minor
                              Found in research/seq_flow_lite/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 _find_all_best_thresh has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def _find_all_best_thresh(
                              Severity: Minor
                              Found in official/nlp/tools/squad_evaluate_v2_0.py - About 45 mins to fix

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

                                def get_data(dataset,
                                Severity: Minor
                                Found in research/attention_ocr/python/data_provider.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language