Showing 494 of 703 total issues
Function _examine_class
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def _examine_class(
target_module, target_class, determine_match, path, class_name, match
):
"""
Examine a class from a given path
- 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
File distro.py
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
Function merge
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def merge(self, other):
"""
Merges `other` node into this one without checking the name of the
other node. New values are appended, existing values overwritten
and unaffected ones are kept. Then all other node children are
- 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
File diff.py
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
File disk.py
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
File output_check.py
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import os
import unittest
from avocado.core import exit_codes
File core.py
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
import ast
import collections
import sys
from importlib.machinery import PathFinder
Function factory
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
var factory = function( $, DataTable ) {
"use strict";
/* Set the defaults for DataTables initialisation */
File memory.py
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
ArchiveTest
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class ArchiveTest(unittest.TestCase):
def setUp(self):
prefix = temp_dir_prefix(self)
self.basedir = tempfile.TemporaryDirectory(prefix=prefix)
self.compressdir = tempfile.mkdtemp(dir=self.basedir.name)
TapParserTests
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class TapParserTests(unittest.TestCase):
def assert_test(self, events, **kwargs):
if "explanation" not in kwargs:
kwargs["explanation"] = None
self.assertEqual(next(events), TapParser.Test(**kwargs))
Function makeState
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def makeState(self, state, sym):
assert sym is not None
#
# Compute \epsilon-kernel state's core and see if
# it exists already.
- 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
File plugin_interfaces.py
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
File job.py
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import os
import tempfile
import unittest.mock
File multipath.py
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
Function clean_hash_table
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def clean_hash_table(self, combination_matrix, t_value):
for constraint in self.constraints:
if len(constraint) > t_value:
continue
parameters_in_constraint = []
- 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 simplify_constraints
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def simplify_constraints(self):
items_to_remove = set()
copy = list(self.constraints.copy())
for i in range(len(copy)):
is_brake = False
- 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 makeSet
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def makeSet(self, token, sets, i):
cur, next_item = sets[i], sets[i + 1]
ttype = ( # pylint: disable=R1709
token is not None and self.typestring(token) or 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 compare_matrices
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def compare_matrices(matrix1, matrix2, threshold=0.05):
"""
Compare 2 matrices nxm and return a matrix nxm with comparison data and
stats. When the first columns match, they are considered as header and
included in the results intact.
- 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 sys_v_init_result_parser
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def sys_v_init_result_parser(command):
"""
Parse results from sys_v style commands.
command status: return true if service is running.
- 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"