Showing 123 of 188 total issues
Function inclusion
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
def inclusion(fieldwalker, positioned, located_match, init_doc):
_doc_type = fieldwalker.doc_type
def _inclusion(node, init_doc=None):
doc = node.value
- 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 parser
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
def parser(self, spec, qfilter):
""" """
self.array_op_type = self.ARRAY_OP_NORMAL
for key, val in spec.items():
- 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 queries.py
has 671 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from copy import deepcopy
from datetime import datetime
from collections.abc import Mapping
File field_walker.py
has 650 lines of code (exceeds 250 allowed). Consider refactoring. Open
class _NoVal(object):
def __repr__(self):
return "_NoVal()"
__slots__ = ()
File update.py
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import OrderedDict
from datetime import datetime
from ..errors import WriteError
Function exclusion
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def exclusion(fieldwalker, init_doc):
_doc_type = fieldwalker.doc_type
def _exclusion(node, init_doc=None):
doc = node.value
- 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 extract
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def extract(self, visited_only=False):
ON_DELETE = False
if isinstance(self.handler, FieldTreeWriter):
ON_DELETE = self.handler.on_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"
Further reading
File collection.py
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
import warnings
from copy import deepcopy
from .base import (
BaseObject,
Function parse_all
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def parse_all(query):
field_op_ls = set(QueryFilter({}).field_ops.keys())
field_op_ls.remove("$eq")
field_op_ls.remove("$not")
- 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 ordering
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def ordering(fieldwalkers, order, doc_type=None):
""" """
total = len(fieldwalkers)
pre_sect_stack = []
- 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 project.py
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
from ..errors import OperationFailure
from .queries import QueryFilter
from .field_walker import _no_val
from ..types import (
string_types,
File sqlite.py
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import shutil
import sqlite3
import contextlib
from collections import OrderedDict
Function parse_slice
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def parse_slice(self, field_path, slicing):
def _slice(fieldwalker):
if "$" in field_path:
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"
Further reading
Function __call__
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, array):
new_array = (array or [])[:]
new_elems = self.mods["$each"][:]
position = self.mods["$position"]
- 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 parse_lte
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def parse_lte(query):
_dec_NaN_INF_ls = list(bson.decimal128_NaN_ls) + [bson.decimal128_INF]
@keep(query)
def _lte(fieldwalker):
- 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 _eq_match
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _eq_match(fieldwalker, query):
""" """
if is_duckument_type(query):
for val in fieldwalker.value:
if is_duckument_type(val):
- 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 _iter
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _iter(self, array_only, unpack, pack):
"""Value iterator
Args:
array_only (bool): Yield only `list` type values.
- 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 parse_gte
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def parse_gte(query):
@keep(query)
def _gte(fieldwalker):
for value in fieldwalker.value:
if _is_comparable(value, 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 _perr_doc
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def _perr_doc(val):
"""
For pretty error msg, same as Mongo
"""
v_lis = []
- 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 parse_pull
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def parse_pull(field, value_or_conditions, array_filters):
if is_duckument_type(value_or_conditions):
query_spec = {}
for k, v in value_or_conditions.items():
if not k[: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"