Showing 7 of 9 total issues
Function main
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
"""一致検索の場合"""
# フィルタの指定
view: MatchValue = [100, 1000, 10000]
mylist: MatchValue = [10, 100]
Function and_
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def and_(self, keyword: Union[str, list[str]]) -> "SnapshotSearchAPIV2And":
"""
AND 検索に利用する。
NOT 検索に必要なパラメータは `query()` で指定する。
:param keyword: 検索するキーワード。文字列または文字列を要素に持つリスト。リストにする場合は OR で連結される。
- 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 _request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _request(
self,
timeout: float,
total_time: float,
) -> Tuple[SnapshotSearchAPIV2Result, float]:
- 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
Consider simplifying this complex logical expression. Open
if (
((keyword[0] != '"' and keyword[-1] != '"') and " " in keyword)
or keyword[0] == "-"
or '"' in keyword
or "\\" in keyword
Function targets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def targets(targets: Set[FieldType]) -> SnapshotSearchAPIV2Targets:
"""
検索対象のフィールドタイプを指定して検索を行う。
: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 _arrange_keyword
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _arrange_keyword(self, keyword: str, exclude: bool = False):
"""
キーワードを適切な形でクエリに指定する。
:param keyword: クエリのqキーに指定するための文字列
"""
- 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 request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def request(
self,
timeout: float = 400.0,
) -> SnapshotSearchAPIV2Result:
"""
- 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"