Showing 494 of 703 total issues
Function to_str
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def to_str(self, summary, variants, **kwargs):
"""
Return human readable representation
The summary/variants accepts verbosity where 0 means silent and
- 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 find_python_tests
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def find_python_tests(target_module, target_class, determine_match, path):
"""
Attempts to find Python tests from source files
A Python test in this context is a method within a specific type
- 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
JobTest
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class JobTest(unittest.TestCase):
def setUp(self):
self.job = None
prefix = temp_dir_prefix(self)
self.tmpdir = tempfile.TemporaryDirectory(prefix=prefix)
Test
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Test(unittest.TestCase, TestData):
"""
Base implementation for the test class.
You'll inherit from this to write your own tests. Typically you'll want
File assets.py
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Assets plugin functional tests
"""
import os
File varianter.py
has 304 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 set_idle_state
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def set_idle_state(state_number="all", disable=True, setstate=None):
"""
Set/Reset cpu idle states for all cpus.
:param state_number: cpuidle state number, default: `all` all states
- 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 Cit.py
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import random
from avocado_varianter_cit.CombinationMatrix import CombinationMatrix
from avocado_varianter_cit.Solver import Solver
File data_structures.py
has 298 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 data_dir.py
has 297 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 get_arch
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def get_arch():
"""Work out which CPU architecture we're running on."""
cpu_table = [
(b"^cpu.*(RS64|Broadband Engine)", "powerpc"),
(rb"^cpu.*POWER\d+", "powerpc"),
- 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 bootstrap
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
var api = new DataTable.Api( settings );
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var btnDisplay, btnClass;
File nvme.py
has 295 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 archive.py
has 293 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 ResizeControl
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ResizeControl(table) {
var tableBorderSize = table.outerWidth() - table.innerWidth();
this.resizeData = {
isResizing: false,
mouseDownFired: false
File __init__.py
has 291 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 sqlite.py
has 289 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 _get_test_variants
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _get_test_variants(self):
def add_variant(runnable, variant):
runnable = deepcopy(runnable)
runnable.variant = dump_variant(variant)
runnable_with_variant.append(runnable)
- 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 get_docstring_directives_tags
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_docstring_directives_tags(docstring):
"""
Returns the test categories based on a `:avocado: tags=category`
docstring
- 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 gdbmi_parser.py
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (c) 2008 Michael Eddington
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal