Showing 2,238 of 2,238 total issues
Function best_average_two_metrics
has 8 arguments (exceeds 5 allowed). Consider refactoring. Open
def best_average_two_metrics(
Function add_predictions
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def add_predictions(db_engine, model_groups, project_path, experiment_hashes=None, train_end_times_range=None, rank_order='worst', replace=True):
Function make_entity_date_table
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def make_entity_date_table(
Function matrix_with_sorted_columns
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def matrix_with_sorted_columns(self, columns):
"""Return the matrix with columns sorted in the given column order
Args:
columns (list) The order of column names to return.
- 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 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function _validate_keys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _validate_keys(self, aggregation_config):
logger.spam("Validating feature aggregation keys")
for key in [
"from_obj",
"intervals",
- 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 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, config, db_engine, *args, n_processes=1, n_bigtrain_processes=1, n_db_processes=1, **kwargs):
Function get_aequitas_results
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def get_aequitas_results(engine, parameter, schema="test_results", table="aequitas", model_id=None, subset_hash="", tie_breaker="worst"):
Function __init__
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, db_engine, from_obj, attribute_columns, entity_id_column, knowledge_date_column, protected_groups_table_name, replace=True):
Function plot_feature_importances_std_err
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def plot_feature_importances_std_err(self,
path,
bar=True,
n_features_plots=30,
figsize=(16,21),
- 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 scores_align_with_ranks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def scores_align_with_ranks(expected_ranks, returned_scores):
'''
Helper function to check that scores align with ranks
correctly for the ranking baselines (e.g., higher ranks
get higher scores and ties have the same score)
- 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 remove_entity_id_and_knowledge_dates
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def remove_entity_id_and_knowledge_dates(filenames, matrix_uuid):
"""drop entity id and knowledge date from all features and label files but one"""
correct_filenames = []
for i in range(len(filenames)):
- 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
Avoid deeply nested control flow statements. Open
if col.name in lookup:
raise ValueError("Duplicate feature column name found: ", col.name)
lookup[col.name] = agg
Function process_task
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_task(self, test_store, train_store, train_kwargs):
logger.verbose(f"Training {train_kwargs.get('class_path')}({train_kwargs.get('parameters')}) [{train_kwargs.get('model_hash')}] on train matrix {train_store.uuid}")
# If the matrices and train labels are OK, train and test the model!
with self.model_trainer.cache_models(), test_store.cache(), train_store.cache():
- 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
Avoid deeply nested control flow statements. Open
if (
feat in exp_imp_cols
and coltype != "categorical"
and imp != "zero_noflag"
):
Function make_metadata
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def make_metadata(
Function build_matrix
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def build_matrix(
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
col,
op,
choices,
- 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_matrix_definitions
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
def generate_matrix_definitions(
Function best_avg_var_penalized
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def best_avg_var_penalized(df, train_end_time, metric, parameter, stdev_penalty, n=1):
"""Pick the model with the highest
average metric value so far, placing less weight in older
results. You need to specify two parameters: the shape of how the
weight affects points (decay_type, linear or exponential) and the relative
- 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"