Showing 10 of 16 total issues
File instance.py
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import asyncio
import asyncio.subprocess
import functools
import logging
File connection.py
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import enum
import functools
import os
from typing import Optional, Type, Union
File api.py
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
import enum
from typing import Any, Dict, List, Optional, Union
from asynctnt.iproto import protocol
Function _log_reader
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _log_reader(self):
def check_io():
fds = []
for h in [self._process.stdout, self._process.stderr]:
if h is not None and not h.closed:
- 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 exceptions.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import enum
from typing import Optional
from asynctnt.iproto.protocol import IProtoError
Function cythonize
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def cythonize(self):
try:
import Cython
except ImportError as e:
raise RuntimeError(
- 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 main
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def main():
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
parser = argparse.ArgumentParser()
parser.add_argument(
"-n", type=int, default=200000, help="number of executed requests"
- 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
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def start(self, *, wait=True, recreate=True):
self._logger.info("Starting Tarantool instance (%s)", self._title)
initlua_path = self.prepare(recreate)
self._logger.info("Launching process")
- 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 _wait
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _wait(self, timeout, wait=True):
if self._process:
if wait:
try:
self._process.wait(timeout)
- 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 os.path.exists(cfile) and not self.cython_always:
extension.sources[i] = cfile
else:
need_cythonize = True