Showing 82 of 82 total issues
Avoid too many return
statements within this function. Open
return '5'
Avoid too many return
statements within this function. Open
return '9'
Avoid too many return
statements within this function. Open
return preprocessing_result
Avoid too many return
statements within this function. Open
return ClosingBracket()
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return '4'
Avoid too many return
statements within this function. Open
return Operator(value)
Avoid too many return
statements within this function. Open
return '1'
Avoid too many return
statements within this function. Open
return '2'
Avoid too many return
statements within this function. Open
return '6'
Function get_word_splitter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_word_splitter(self) -> Optional[Splitter]:
split_param_value = self.get_param_value(PrepParam.SPLIT)
if split_param_value in ['4', '5', '6', '7', '8', '9']:
return lambda s, c: get_bpe_subwords(s, c)
elif split_param_value in ['1', '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 to_char_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_char_list(word: str):
i = 0
res = []
while i < len(word):
if word[i] != ESCAPE_CHAR or i+1 == len(word):
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create(cls: Type['Dataset'], path_to_dataset: str, prep_config: PrepConfig, extensions: Optional[str],
custom_bpe_config: Optional[CustomBpeConfig],
bpe_config: Optional[BpeConfig] = None,
overriden_path_to_prep_dataset: Optional[str] = None, suppress_caching: bool = False) -> 'Dataset':
if not os.path.exists(path_to_dataset):
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create(merge_list_id: str, n_merges: int) -> 'CustomBpeConfig':
dataset_bpe_dir = get_dataset_bpe_dir(merge_list_id)
min_merges = get_min_merges(dataset_bpe_dir, limit=n_merges)
# check if not None?
dir_with_min_merges = os.path.join(dataset_bpe_dir, str(min_merges))
- 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 from_suffix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_suffix(suffix: str):
if suffix.find(BpeConfig.CASE_NO) != -1:
case = 'no'
elif suffix.find(BpeConfig.CASE_PREFIX) != -1:
case = 'prefix'
- 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 preprocess
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def preprocess(text: str, config: PrepConfig, bpe_codes_id: Optional[str] = None, extension: Optional[str] = None,
force_reinit_bpe_data: bool = True, append_eof: bool = False, path: Optional[Path] = None) \
-> Union[TokenSequence, Tuple[TokenSequence, SnippetStructure]]:
parsed = [parsed_token for parsed_token in convert_text(text, extension)]
parsed = remove_trailing_newline(parsed)
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def transform(self, value: str) -> Operator:
if value == ';':
return Semicolon()
elif value == '{':
return OpeningCurlyBracket()
- 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
Method equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
MoveResult that = (MoveResult) o;
- 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
Method makeMove
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private MoveResult makeMove(Player player) {
PlayerStats playerStats = this.gameStats.getPlayerStats(player);
Set<Combination> availableCombinations = playerStats.getAvailableCombinations();
DiceLayout fixedDiceLayout = DiceLayout.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 __next__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __next__(self) -> 'CodeLocation':
try:
return next(self.snippet_iterator)
except StopIteration:
self.current_snippet += 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"