Showing 204 of 260 total issues
Function main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def main(output_path):
with open(output_path, "w") as w:
with psycopg2.connect("dbname=pikabu user=postgres password=postgres") as connection:
with connection.cursor(name="stories") as cursor:
- 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 predict_saiga_k_shots
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_saiga_k_shots(
Function predict_rwsd
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_rwsd(
Function predict_terra
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_terra(
Function generate_answers
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_answers(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function predict_saiga_zero_shot
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_saiga_zero_shot(
Function main
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(
Function predict_russe
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_russe(
Function predict_muserc
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_muserc(
Function predict_parus
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_parus(
Function main
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(
Function predict_danetqa
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_danetqa(
Function predict_rcb
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_rcb(
Function custom_prepare_model_for_int8_training
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def custom_prepare_model_for_int8_training(
model,
output_embedding_layer_name="lm_head",
layer_norm_names=["layer_norm"]
):
- 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 generate_answers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_answers(
model_name: str,
input_path: str,
output_path: str,
batch_size: int = 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"
Further reading
Function to_alpaca_eval
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_alpaca_eval(
input_files: str,
output_path: str,
):
input_files = input_files.split(",")
- 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 interact
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def interact(
Avoid deeply nested control flow statements. Open
for dialogue in record["dialogues"]:
topic = dialogue["topic"]
existing_keys.add(get_dialogue_key(record, topic))
output_records = {get_char_key(char): char for char in output_records}
Function interact
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def interact(