tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/resource_variable_ops.py

Summary

Maintainability
F
1 wk
Test Coverage

File resource_variable_ops.py has 2278 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2016 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/ops/resource_variable_ops.py - About 6 days to fix

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

      def __init__(  # pylint: disable=super-init-not-called
    Severity: Major
    Found in tensorflow/python/ops/resource_variable_ops.py - About 2 hrs to fix

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

        def __init__(
      Severity: Major
      Found in tensorflow/python/ops/resource_variable_ops.py - About 2 hrs to fix

        Function _init_from_args has 14 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def _init_from_args(
        Severity: Major
        Found in tensorflow/python/ops/resource_variable_ops.py - About 1 hr to fix

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

            def __init__(  # pylint: disable=super-init-not-called
          Severity: Major
          Found in tensorflow/python/ops/resource_variable_ops.py - About 1 hr to fix

            Function _strided_slice_assign has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def _strided_slice_assign(self, begin, end, strides, value, name, begin_mask,
            Severity: Major
            Found in tensorflow/python/ops/resource_variable_ops.py - About 1 hr to fix

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

                def __init__(self, handle, dtype, shape, in_graph_mode, parent_op, unique_id):
              Severity: Major
              Found in tensorflow/python/ops/resource_variable_ops.py - About 50 mins to fix

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

                def _variable_handle_from_shape_and_dtype(shape,
                Severity: Minor
                Found in tensorflow/python/ops/resource_variable_ops.py - About 45 mins to fix

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

                  def eager_safe_variable_handle(initial_value, shape, shared_name, name,
                  Severity: Minor
                  Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                      def assign(self, value, use_locking=None, name=None, read_value=True):
                    Severity: Minor
                    Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                        def _export_to_saved_model_graph(self, object_map=None, tensor_map=None,
                      Severity: Minor
                      Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                          def assign(self, value, use_locking=None, name=None, read_value=True):
                        Severity: Minor
                        Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                            def __init__(self, shape, dtype=dtypes.float32, trainable=True,
                          Severity: Minor
                          Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

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

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

                                def assign_sub(self, delta, use_locking=None, name=None, read_value=True):
                              Severity: Minor
                              Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                                  def assign_add(self, delta, use_locking=None, name=None, read_value=True):
                                Severity: Minor
                                Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                                    def assign_add(self, delta, use_locking=None, name=None, read_value=True):
                                  Severity: Minor
                                  Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

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

                                      def assign_sub(self, delta, use_locking=None, name=None, read_value=True):
                                    Severity: Minor
                                    Found in tensorflow/python/ops/resource_variable_ops.py - About 35 mins to fix

                                      Function _combine_handle_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def _combine_handle_data(handle, initial_value):
                                        """Concats HandleData from tensors `handle` and `initial_value`.
                                      
                                        Args:
                                          handle: A `Tensor` of dtype `resource`.
                                      Severity: Minor
                                      Found in tensorflow/python/ops/resource_variable_ops.py - About 25 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

                                      There are no issues that match your filters.

                                      Category
                                      Status