tensorflow/python/checkpoint/checkpoint.py
File checkpoint.py
has 2092 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Utilities for saving/loading Trackable objects."""
# 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.
Function node_names
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
def node_names(self):
"""Lazily creates a mapping from node id to ("path", "to", "root")."""
if self._node_name_cache is not None:
return self._node_name_cache
path_to_root = {}
- Read upRead up
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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, object_graph_proto, save_path, save_path_tensor, reader,
Function add_variable
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_variable(trackable,
Function _default_getter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _default_getter(name,
Function save
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def save(self,
Function restore_saveables
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def restore_saveables(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, expect_partial, object_graph_proto, matched_proto_ids,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, checkpoint, feed_dict, graph_view, options):
Function _trackable_custom_creator
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _trackable_custom_creator(next_creator,