Showing 99 of 1,043 total issues
Avoid deeply nested control flow statements. Open
Open
if x[0] == agent[idx]:
self.tap(x[1], x_rate=0.5, y_rate=0.5, interval=0)
found = 1
break
Avoid deeply nested control flow statements. Open
Open
if min_mood == -99:
min_mood = agent['mood']
break
Function swipe
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def swipe(
Avoid deeply nested control flow statements. Open
Open
for y in ret:
if y[0] == '菲亚梅塔':
self.tap((y[1][0]), interval=0, rebuild=False)
break
agent.remove('菲亚梅塔')
Avoid deeply nested control flow statements. Open
Open
for _ in range(9):
self.swipe_only((w//2, h//2), (w//2, 0), interval=0.5)
self.swipe((w//2, h//2), (w//2, 0), interval=3, rebuild=False)
Avoid deeply nested control flow statements. Open
Open
for x in group_resting:
if self.operators[x['agent']]['resting_priority'] == 'low':
continue
else:
group_restingCount += 1
Avoid deeply nested control flow statements. Open
Open
if error_count >= 3:
raise e
# 返回基建干员进驻总览
self.recog.update()
Avoid deeply nested control flow statements. Open
Open
if a == "Current":
continue
elif 'exhaust_require' in self.operators[a].keys() and self.operators[a]['exhaust_require']:
ignore.append(a)
resting_dorm.extend([self.operators[a]['current_room'] for a in ignore])
Avoid deeply nested control flow statements. Open
Open
if dorm not in read_time_rooms:
continue
if dorm in time_result.keys() and min_time > time_result[dorm]:
Avoid deeply nested control flow statements. Open
Open
if group_restingCount + actuall_resting <= self.dorm_count:
need_to_rest.extend(group_resting)
actuall_resting += group_restingCount
else:
# 因为人数不够而跳过记录心情
Avoid deeply nested control flow statements. Open
Open
if self.find('arrange_empty_room') is None:
if self.find('arrange_clean') is not None:
self.tap_element('arrange_clean')
else:
# 对于只有一个干员的房间,没有清空按钮,需要点击干员清空
Avoid deeply nested control flow statements. Open
Open
if base_room_list[idx].startswith('dormitory'):
default_order = ArrangeOrder.FEELING
else:
default_order = ArrangeOrder.SKILL
self.choose_agent(
Avoid deeply nested control flow statements. Open
Open
if dorm in time_result.keys() and min_time > time_result[dorm]:
min_time = time_result[dorm]
_plan["time"] = min_time
Avoid deeply nested control flow statements. Open
Open
if k not in existing_plan['plan']:
existing_plan['plan'][k] = _plan['plan'][k]
else:
for idx, _a in enumerate(_plan['plan'][k]):
if _plan['plan'][k][idx] != 'Current':
Avoid deeply nested control flow statements. Open
Open
if next((e for e in self.tasks if 'type' in e.keys() and e['type'] == agent['agent']),
None) is None:
__agent = self.operators[agent['agent']]
self.enter_room(__agent['current_room'])
result = self.get_agent_from_room(__agent['current_room'], [__agent['current_index']])
Avoid deeply nested control flow statements. Open
Open
if x in possibility[o].ls:
possibility[o].poss += 1
possibility[o].poss /= len(possibility[o].ls)
Function tap
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def tap(self, points: list[tuple[int, int]], display_frames: tuple[int, int, int], pressure: int = 100, duration: int = None, lift: bool = True) -> None:
Function read_screen
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def read_screen(self,img, type="mood",limit=24, cord=None, change_color=False):
Function agent_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def agent_name(__img, height,reverse = False, draw: bool = False):
query = cv2.cvtColor(np.array(__img), cv2.COLOR_RGB2GRAY)
h, w= query.shape
dim = (w*4, h*4)
# resize image
- 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 get_clue_mask
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_clue_mask(self) -> None:
""" 界面内是否有被选中的线索 """
try:
mask = []
for y in range(y1, y2):
- 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"