Showing 118 of 118 total issues
Avoid too many return
statements within this function. Open
return JSONListType(field_class_to_schematics_field(field._ArrayField__field), **kwargs)
Avoid too many return
statements within this function. Open
if self.is_finished: return
Avoid too many return
statements within this function. Open
return BlobType(**kwargs)
Avoid too many return
statements within this function. Open
return StringType(**kwargs)
Avoid too many return
statements within this function. Open
return myfunc
Avoid too many return
statements within this function. Open
return BooleanType(**kwargs)
Avoid too many return
statements within this function. Open
return ret
Avoid too many return
statements within this function. Open
return ret
Function make_mocked_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_mocked_request(method, path: str, *, headers: Dict[str, str] = None, body: bytes = None):
path_split = path.split('?', 1)
path = path_split[0]
if len(path_split) > 1:
- 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 fields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fields(self):
if not self._fields:
self._fields = {}
for name, v in self.val._meta.fields.items():
if isinstance(v, peewee.ForeignKeyField):
- 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 roles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def roles(self) -> Set:
if not self.can_get_user:
raise NoUserViewMixinException("Current View should inherited from `BaseUserViewMixin` or it's subclasses")
if self._current_user_roles is not None:
return self._current_user_roles
- 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 _json_try_convert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _json_try_convert(value, err, no_throw=False):
if isinstance(value, (bytes, str)):
try:
return json.loads(value)
except json.JSONDecodeError:
- 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 view
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def view(self, url, tag_name=None):
"""
Register View Class
:param url:
:param tag_name:
- 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 filterValues
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function filterValues (filter, data) {
let keys = null
if (_.isArray(filter)) keys = new Set(filter)
else if (_.isSet(filter)) keys = filter
else if (_.isFunction(filter)) return filter(data)
- 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 bind
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def bind(self, view: "AbstractSQLView", action=None, records=None):
"""
建立写入值与 view 的联系。
由于这之后还有一个 before_insert / before_update 的过程,所以这里不尽量抛出异常,只是在装入 values 前把不合规的过滤
:param view:
- 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 to_native
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_native(self, value, context=None):
if isinstance(value, (memoryview, bytes)):
return value
if isinstance(value, str):
- 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 __exit__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __exit__(self, exc_type, exc_val, exc_tb):
db = self.db
if isinstance(exc_val, peewee.IntegrityError):
db.rollback()
if exc_val.args[0].startswith('duplicate key') or '唯一约束' in exc_val.args[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
Function websocket
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def websocket(self, url=None):
"""
Register Websocket
:param url:
:return:
- 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"