Showing 15 of 15 total issues
Function _mv3
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _mv3(self) -> None:
for root, dirs, files in os.walk(self.wrapper.destination, topdown=False):
for name in files:
if str(Path(name).suffix) != ".js":
continue
- 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 _mv3
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _mv3(self) -> None:
needsChange = False
for root, dirs, files in os.walk(self.wrapper.destination, topdown=False):
for name in files:
if str(Path(name).suffix) != ".js":
- 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 _mv3
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _mv3(self) -> None:
"""
from
chrome.tabs.executeScript(
- 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 _mv3
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _mv3(self) -> None:
manifest = self.wrapper.manifest
keys = ["permissions", "optional_permissions"]
result: dict[str, Any] = {
"permissions": [],
- 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
Avoid deeply nested control flow statements. Open
for item in search:
if data.find(item) == -1:
continue
if not isChanged:
isChanged = True
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, args: dict[str, str]) -> None:
source = args["source"]
original_source = source
dirname = os.path.dirname(source)
- 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
Avoid deeply nested control flow statements. Open
for line in infile:
outfile.write(line)
os.remove(scriptFile)
Function extract
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract(self, source: str, destination: str, foldername: str) -> None:
sentinel = False
with zipfile.ZipFile(source, "r") as zip_ref:
list = zip_ref.namelist()
if len(list) == 0:
- 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
Avoid deeply nested control flow statements. Open
if data.find(seek) == -1:
continue
Logger().log("Updating to chrome.scripting.executeScript")
Function _mv3
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _mv3(self) -> None:
manifest = self.wrapper.manifest
if "background" not in manifest or "scripts" not in manifest["background"]:
return
Logger().log("Changing to background.service_worker in manifest.json")
- 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
Avoid deeply nested control flow statements. Open
if data.find(seek) == -1:
continue
Logger().log("Changing to chrome.scripting.insertCSS")
Avoid deeply nested control flow statements. Open
if not isChanged:
return
Logger().log("Changed to chrome.action in .js files")
Avoid deeply nested control flow statements. Open
if not needsChange:
needsChange = True
file.seek(0)
Avoid deeply nested control flow statements. Open
if not needsChange:
needsChange = True
file.seek(0)
Function work
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def work(self, source: str) -> None:
Logger().log(source)
# TODO: Can destination be a command line argument instead?
destination = source + "_delete"
- 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"