Showing 11,634 of 11,634 total issues
Function conv2d_same
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def conv2d_same(inputs, num_outputs, kernel_size, stride, rate=1, scope=None):
Function preprocess_image
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def preprocess_image(image,
Function pix2pix_discriminator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def pix2pix_discriminator(net, num_filters, padding=2, pad_mode='REFLECT',
Function _build_pnasnet_base
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _build_pnasnet_base(images,
Avoid deeply nested control flow statements. Open
with self.test_session() as sess:
tf.set_random_seed(0)
inputs = create_test_input(1, height, width, 3)
# Dense feature extraction followed by subsampling.
output = resnet_utils.stack_blocks_dense(inputs,
Avoid deeply nested control flow statements. Open
if self._use_bounded_activation:
h = tf.nn.relu6(h)
# Add hiddenstate to the list of hiddenstates we can choose from
net.append(h)
Avoid deeply nested control flow statements. Open
if output_stride is None:
factor = 1
else:
factor = nominal_stride // output_stride
output = resnet_utils.subsample(output, factor)
Avoid deeply nested control flow statements. Open
if output_stride % 2 != 0:
raise ValueError('The output_stride needs to be a multiple of 2.')
output_stride //= 2
Avoid deeply nested control flow statements. Open
if current_config[_INPUT] < 0:
operation_input = features
else:
operation_input = branch_logits[current_config[_INPUT]]
if current_config[_OP] == _CONV:
Avoid deeply nested control flow statements. Open
if current_config[_OP] == _CONV:
if current_config[_KERNEL] == [1, 1] or current_config[
_KERNEL] == 1:
branch_logits.append(
slim.conv2d(operation_input, depth, 1, scope=scope))
Function __call__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(self, net, scope, filter_scaling, stride, prev_layer, cell_num):
Function lenet
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def lenet(images, num_classes=10, is_training=False,
Function build_nasnet_mobile
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_nasnet_mobile(images, num_classes,
Function restore_model
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def restore_model(sess, checkpoint_path, enable_ema=True):
"""Restore variables from the checkpoint into the provided session.
Args:
sess: A tensorflow session where the checkpoint will be loaded.
- 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 cifarnet
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def cifarnet(images, num_classes=10, is_training=False,
Function resolve_shape
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve_shape(tensor, rank=None, scope=None):
"""Fully resolves the shape of a Tensor.
Use as much as possible the shape components already known during graph
creation and resolve the remaining ones during runtime.
- 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 preprocess_for_train
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def preprocess_for_train(image,
Function _combine_unused_states
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _combine_unused_states(self, net):
"""Concatenate the unused hidden states of the cell."""
used_hiddenstates = self._used_hiddenstates
final_height = int(net[-1].shape[2])
- 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 build_nasnet_large
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_nasnet_large(images, num_classes,
Function preprocess_for_train
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def preprocess_for_train(image,