Showing 99 of 1,043 total issues
Function overtake_room
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def overtake_room(self):
name = self.task['type']
candidate = []
if self.operators[name]['group'] != '':
candidate.extend([v['name'] for k, v in self.operators.items() if
- 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 initBtn
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def initBtn(event):
room_key = event[4:]
station_name = plan[room_key]['name'] if room_key in plan.keys() else ''
plans = plan[room_key]['plans'] if room_key in plan.keys() else []
if room_key.startswith('room'):
- 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 recruit.py
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from ..data import recruit_agent, recruit_tag
from ..ocr import ocr_rectify, ocrhandle
from ..utils import segment
Function clue
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def clue(self) -> None:
# 一些识别时会用到的参数
global x1, x2, x3, x4, y0, y1, y2
x1, x2, x3, x4 = 0, 0, 0, 0
y0, y1, y2 = 0, 0, 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 read_screen
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def read_screen(self,img, type="mood",limit=24, cord=None, change_color=False):
if cord is not None:
img = img[cord[1]:cord[3], cord[0]:cord[2]]
if 'mood' in type or type == "time":
# 心情图片太小,复制8次提高准确率
- 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 drone
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def drone(self, room: str, one_time=False, not_return=False):
logger.info('基建:无人机加速')
# 点击进入该房间
self.enter_room(room)
- 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 solver.py
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
import time
import traceback
from abc import abstractmethod
BaseSolver
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseSolver:
""" Base class, provide basic operation """
def __init__(self, device: Device = None, recog: Recognizer = None) -> None:
# self.device = device if device is not None else (recog.device if recog is not None else Device())
Function parse_operation_params
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def parse_operation_params(args: ParamArgs = []):
level = None
times = -1
potion = 0
originite = 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 menu
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def menu():
global window
global buffer
loadConf()
sg.theme('LightBlue2')
Function scan_agant
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def scan_agant(self, agent: list[str], error_count=0, max_agent_count=-1):
try:
# 识别干员
self.recog.update()
ret = character_recognize.agent(self.recog.img) # 返回的顺序是从左往右从上往下
- 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 ori_clue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def ori_clue(self):
""" 获取界面内有多少线索 """
clues = []
y3 = y1
status = -2
- 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 free_agent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def free_agent(img, draw=False):
"""
识别未在工作中的干员
"""
try:
- 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 menu
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def menu():
global window
global buffer
loadConf()
sg.theme('LightBlue2')
- 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 add_tasks
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def add_tasks(solver: ScheduleSolver = None, tag: str = ''):
"""
为 schedule 模块添加任务
"""
plan = config.SCHEDULE_PLAN.get(tag)
- 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 sift_recog
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def sift_recog(query, resolution, draw=False,reverse = False):
"""
使用 SIFT 提取特征点识别干员名称
"""
agent_sift_init()
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function loadPlan
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def loadPlan(url):
global plan
if not os.path.isfile(url):
with open(url, 'w') as f:
json.dump(plan, f) # 创建空json文件
- 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 transition
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def transition(self) -> None:
self.recog.update()
if self.scene() == Scene.INDEX:
self.tap_element('index_infrastructure')
elif self.scene() == Scene.INFRA_MAIN:
- 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_device
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init_device(self) -> None:
# wait for the newly started ADB server to probe emulators
time.sleep(1)
if self.device_id is None or self.device_id not in config.ADB_DEVICE:
self.device_id = self.__choose_devices()
- 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"