Showing 155 of 224 total issues
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Consider simplifying this complex logical expression. Open
if (a && !1 !== b.isActive)if (!1 === b.trigger("afterLoad", a, d))a.wrap.stop(!0).trigger("onReset").remove(), b.coming = null; else {
d && (b.trigger("beforeChange", d), d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());
b.unbindEvents();
e = a.content;
c = a.type;
Function _load_plugins_generic
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _load_plugins_generic(
Consider simplifying this complex logical expression. Open
if (h.fitToView)if (g.width(c).height(j), e.width(c + x), a = e.width(), y = e.height(), h.aspectRatio)for (; (a > z || y > r) && (c > m && j > u) && !(19 < d++);)j = Math.max(u, Math.min(p, j - 10)), c = l(j * D), c < m && (c = m, j = l(c / D)), c > n && (c = n, j = l(c / D)), g.width(c).height(j), e.width(c + x), a = e.width(), y = e.height(); else c = Math.max(m, Math.min(c, c - (a - z))), j = Math.max(u, Math.min(j, j - (y - r)));
Consider simplifying this complex logical expression. Open
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
$.each(keys, function (i, val) {
if (current.group.length > 1 && val[ code ] !== undefined) {
F[ i ](val[ code ]);
Function version2tuple
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def version2tuple(version: str) -> Tuple:
vsplit = version.split("-")
if len(vsplit) == 2:
main, sub = vsplit
- 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 serve_forever
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def serve_forever(self) -> None:
"""
Connect the back-end to the server and serve forever.
Back-ends MAY choose to re-implement this method, in which case
- 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 send_stream_request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def send_stream_request(
self,
identifier: Union[TelegramPerson, TelegramMUCOccupant],
fsource: Union[str, dict, BinaryIO],
name: Optional[str] = "file",
- 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 search_repos
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def search_repos(self, query: str) -> Generator[RepoEntry, None, None]:
"""
A simple search feature, keywords are AND and case insensitive on all the fields.
:param query: a string query
- 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 __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function send_templated
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_templated(
Function program_next_poll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def program_next_poll(
Function send_stream_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_stream_request(
Avoid deeply nested control flow statements. Open
if not may_access_command(msg, name):
continue
pairs.append((name, command))
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function send_templated
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_templated(
Avoid deeply nested control flow statements. Open
for flow in self._bot.flow_executor.in_flight:
if self.check_user(msg, flow):
next_steps = [
f"\\*{str(step[1].command)}\\*"
for step in flow._current_step.children
Function main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def main():
find_plugins("err")
# Those are found by global search only available on github UI:
# https://github.com/search?l=&q=Documentation+extension%3Aplug&ref=advsearch&type=Code&utf8=%E2%9C%93
url = "https://api.github.com/repos/%s"
- 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 start_poller
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def start_poller(