Showing 11,634 of 11,634 total issues
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_0'):
branch_0 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
with tf.variable_scope('Branch_1'):
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_2'):
branch_2 = slim.conv2d(net, 32, [1, 1], scope='Conv2d_0a_1x1')
branch_2 = slim.conv2d(branch_2, 64, [3, 3], scope='Conv2d_0b_3x3')
with tf.variable_scope('Branch_3'):
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_0'):
branch_0 = slim.conv2d(net, 384, [1, 1], scope='Conv2d_0a_1x1')
with tf.variable_scope('Branch_1'):
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_2'):
branch_2 = slim.conv2d(net, 48, [1, 1], scope='Conv2d_0a_1x1')
branch_2 = slim.conv2d(branch_2, 128, [3, 3], scope='Conv2d_0b_3x3')
with tf.variable_scope('Branch_3'):
Function cyclegan_upsample
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def cyclegan_upsample(net, num_outputs, stride, method='conv2d_transpose',
Avoid deeply nested control flow statements. Open
Open
if final_endpoint == end_point:
return net, end_points
end_point = 'MaxPool_3a_3x3'
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_2'):
branch_2 = slim.conv2d(net, 16, [1, 1], scope='Conv2d_0a_1x1')
branch_2 = slim.conv2d(branch_2, 48, [3, 3], scope='Conv2d_0b_3x3')
with tf.variable_scope('Branch_3'):
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_3'):
branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
net = tf.concat(
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_0'):
branch_0 = slim.conv2d(net, 256, [1, 1], scope='Conv2d_0a_1x1')
with tf.variable_scope('Branch_1'):
Avoid deeply nested control flow statements. Open
Open
if final_endpoint == end_point:
return net, end_points
end_point = 'Conv2d_2c_3x3'
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_3'):
branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
branch_3 = slim.conv2d(branch_3, 32, [1, 1], scope='Conv2d_0b_1x1')
net = tf.concat(
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_3'):
branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
branch_3 = slim.conv2d(branch_3, 64, [1, 1], scope='Conv2d_0b_1x1')
net = tf.concat(
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_1'):
branch_1 = slim.conv2d(net, 112, [1, 1], scope='Conv2d_0a_1x1')
branch_1 = slim.conv2d(branch_1, 224, [3, 3], scope='Conv2d_0b_3x3')
with tf.variable_scope('Branch_2'):
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_3'):
branch_3 = slim.max_pool2d(net, [3, 3], scope='MaxPool_0a_3x3')
branch_3 = slim.conv2d(branch_3, 128, [1, 1], scope='Conv2d_0b_1x1')
net = tf.concat(
Function split_conv
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def split_conv(input_tensor,
Avoid deeply nested control flow statements. Open
Open
if final_endpoint == end_point:
return net, end_points
Avoid deeply nested control flow statements. Open
Open
with tf.variable_scope('Branch_0'):
branch_0 = slim.conv2d(net, 192, [1, 1], scope='Conv2d_0a_1x1')
with tf.variable_scope('Branch_1'):
Avoid deeply nested control flow statements. Open
Open
if spatial_squeeze:
net = tf.squeeze(net, [1, 2], name='fc8/squeezed')
end_points[sc.name + '/fc8'] = net
Function mobilenet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def mobilenet(input_tensor,
num_classes=1001,
depth_multiplier=1.0,
scope='MobilenetV2',
conv_defs=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 conv2d_same
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def conv2d_same(inputs, num_outputs, kernel_size, stride, rate=1, scope=None):