Showing 22 of 22 total issues
File executor.py
has 769 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import hashlib
import io
File main.py
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
import os
import shutil
Function segment
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
TinySegmenter.prototype.segment = function(input) {
if (input == null || input == undefined || input == "") {
return [];
}
var result = [];
Function challenge
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def challenge(arg_dict: dict) -> dict:
"""
[[[ WARNING !!!!! ]]]
`arg_dict` is dict like `ChallengeArg` because HttpMethod(OwlEnum) can't be pickled.
Return value is dict like `Trial` because Status(OwlEnum) can't be pickled.
- 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 models.py
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
import datetime
from typing import Any, List, Optional
from owlmixin import OwlEnum, OwlMixin, TDict, TList, TOption
Function challenge
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def challenge(arg_dict: dict) -> dict:
"""
[[[ WARNING !!!!! ]]]
`arg_dict` is dict like `ChallengeArg` because HttpMethod(OwlEnum) can't be pickled.
Return value is dict like `Trial` because Status(OwlEnum) can't be pickled.
Function TinySegmenter
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TinySegmenter() {
var patterns = {
"[一二三四五六七八九十百千万億兆]":"M",
"[一-龠々〆ヵヶ]":"H",
"[ぁ-ん]":"I",
Function exec
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def exec(
self, payload: FinalAddOnPayload, reference: FinalAddOnReference
) -> FinalAddOnPayload:
if When.NOT_EMPTY in self.config.when and payload.report.trials.size() == 0:
logger.info_lv1("Skip sending results to Miroir because trials are empty.")
- 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 config_generator
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def config_generator(blockstr: str, header_regexp: str, record_regexp: str):
key = None
d: dict = {}
# XXX: [""] means for the case which last line break is nothing
- 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 concurrent_request
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def concurrent_request(
Function judgement
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def judgement(
Function run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run(args: Args):
init_logger(0)
# TODO: refactoring
if args.name.get() == "addon":
- 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 clean
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def clean(self, values):
keys = list(values.keys())
for k in keys:
v = values[k]
if isinstance(v, 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 exec
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exec(
self, payload: FinalAddOnPayload, reference: FinalAddOnReference
) -> FinalAddOnPayload:
if When.NOT_EMPTY in self.config.when and payload.report.trials.size() == 0:
logger.info_lv1("Skip sending results to Miroir because trials are empty.")
Function exec
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def exec(self, payload: Res2ResAddOnPayload) -> Res2ResAddOnPayload:
res: Response = payload.response
if res.type != "json":
logger.info_lv3(f"{LOG_PREFIX} Skipped because this response is not 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 __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, addons: Addons) -> None:
self.log2reqs = create_addon(addons.log2reqs, "log2reqs")
self.reqs2reqs = (
addons.reqs2reqs.map(lambda x: create_addon(x, "reqs2reqs"))
if addons
- 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 store_criterion
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def store_criterion(
Function __run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __run(
Function create_config
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_config(config_paths: TList[str], skip_tags: TOption[TList[str]]) -> Config:
def filter_by_tags(addons: List[dict]) -> List[dict]:
return [
x
for x in addons
- 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 merge_args2config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def merge_args2config(args: MergedArgs, config: Config) -> Config:
return Config.from_dict(
{
"one": config.one,
"other": config.other,
- 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"