tensorflow/tensorflow

View on GitHub
tensorflow/python/data/ops/dataset_ops.py

Summary

Maintainability
F
1 wk
Test Coverage

File dataset_ops.py has 4052 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in tensorflow/python/data/ops/dataset_ops.py - About 1 wk to fix

    Function bucket_by_sequence_length has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def bucket_by_sequence_length(
    Severity: Major
    Found in tensorflow/python/data/ops/dataset_ops.py - About 1 hr to fix

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

        def __init__(self, variant_tensor):
          """Creates a DatasetV2 object.
      
          This is a difference between DatasetV1 and DatasetV2. DatasetV1 does not
          take anything in its constructor whereas in the DatasetV2, we expect
      Severity: Minor
      Found in tensorflow/python/data/ops/dataset_ops.py - About 1 hr 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 interleave has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def interleave(
      Severity: Major
      Found in tensorflow/python/data/ops/dataset_ops.py - About 50 mins to fix

        Function interleave has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def interleave(
        Severity: Major
        Found in tensorflow/python/data/ops/dataset_ops.py - About 50 mins to fix

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

            def padded_batch(self,
          Severity: Minor
          Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

              def group_by_window(
            Severity: Minor
            Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                def window(
              Severity: Minor
              Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                  def from_generator(generator,
                Severity: Minor
                Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                    def rejection_resample(
                  Severity: Minor
                  Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                      def batch(
                    Severity: Minor
                    Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                        def window(
                      Severity: Minor
                      Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                          def from_generator(
                        Severity: Minor
                        Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                            def snapshot(
                          Severity: Minor
                          Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                              def batch(self,
                            Severity: Minor
                            Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                                def padded_batch(
                              Severity: Minor
                              Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                                def _filter_ds(dataset,
                                Severity: Minor
                                Found in tensorflow/python/data/ops/dataset_ops.py - About 45 mins to fix

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

                                    def shuffle(
                                  Severity: Minor
                                  Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                      def load(
                                    Severity: Minor
                                    Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                        def shuffle(self,
                                      Severity: Minor
                                      Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                          def ragged_batch(
                                        Severity: Minor
                                        Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                            def map(self,
                                          Severity: Minor
                                          Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                              def map(
                                            Severity: Minor
                                            Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                                def save(self,
                                              Severity: Minor
                                              Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                                def _estimate_initial_dist_ds(target_dist_t,
                                                Severity: Minor
                                                Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

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

                                                    def sample_from_datasets(
                                                  Severity: Minor
                                                  Found in tensorflow/python/data/ops/dataset_ops.py - About 35 mins to fix

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status