tensorflow/python/eager/polymorphic_function/polymorphic_function_test.py
File polymorphic_function_test.py
has 3844 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
FunctionTest
has 218 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class FunctionTest(test.TestCase, parameterized.TestCase):
def setUp(self):
super().setUp()
cpus = config.list_physical_devices('CPU')
MultiDeviceTest
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class MultiDeviceTest(test.TestCase, parameterized.TestCase):
def testNestedCallWatchedVariables(self):
v = variables.Variable(4.)
Function testClone
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def testClone(self, input_signature, autograph, autograph_options, implements,
Function testConcreteFunctionFlatSignatureError
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def testConcreteFunctionFlatSignatureError(self,
Function testConcreteFunctionStructuredSignatureError
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def testConcreteFunctionStructuredSignatureError(self,
Function test_pickle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test_pickle(self, input_signature, autograph, autograph_options,
Function dynamic_unroll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def dynamic_unroll(core_fn,
Function f5
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def f5(self, arg1, arg2, arg3, *args, **kwargs):
Function testRetraceLogicWithSideInputs
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def testRetraceLogicWithSideInputs(self, val_before, type_before, val_after,
Function f3
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def f3(self, arg1, arg2, arg3, arg4=4, **kwargs):
Function f3
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def f3(arg1, arg2, arg3, arg4=4, **kwargs):
Function f5
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def f5(arg1, arg2, arg3, *args, **kwargs):
Function test_variable_naming
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def test_variable_naming(self):
class HasVars(module.Module):
def __init__(self):
self.x = None
- 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 testWithExtraWrapperMissingArgs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def testWithExtraWrapperMissingArgs(self):
class Foo(module.Module):
def __init__(self):
- 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"