Showing 2,238 of 2,238 total issues
Function __init__
has 11 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function get_columns
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_columns(self, when=None, prefix=None, format_kwargs=None):
"""
Args:
when: used in a case statement to filter the rows going into the
aggregation function
- 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 process_train_task
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def process_train_task(
self, matrix_store, class_path, parameters, model_hash, misc_db_parameters, random_seed=None, retrain=False, model_group_id=None,
):
"""Trains and stores a model, or skips it and returns the existing id
- 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 11 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function test_compare_lists
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_compare_lists():
d = Compare("col", "=", ["a", "b", "c"], [], {}, include_null=True).quantities
assert len(d) == 4
assert len(set(d.values())) == len(d)
assert len(set(d.keys())) == len(d)
Function build_matrix
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_matrix(
self,
as_of_times,
label_name,
label_type,
Function test_experiment_tracker
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_experiment_tracker(test_engine, project_path):
with mock.patch("triage.util.conf.open", side_effect=open_side_effect) as mock_file:
experiment = MultiCoreExperiment(
config=sample_config(),
db_engine=test_engine,
Function _write_audit_to_db
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def _write_audit_to_db(
Function populate_crosstabs_table
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def populate_crosstabs_table(
Function __init__
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def __init__(
Function _config_axes
has 10 arguments (exceeds 5 allowed). Consider refactoring. Open
def _config_axes(
Function feature_loi_loo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def feature_loi_loo(self,
model_subset=None,
param_type=None,
param=None,
metric=None,
- 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 plot_ranked_correlation_features
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def plot_ranked_correlation_features(self,
model_subset=None,
temporal_comparison=False,
figsize=(12, 16),
fontsize=20,
- 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 add_predictions
has a Cognitive Complexity of 10 (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):
""" For a set of modl_groups generate test predictions and write to DB
Args:
db_engine: Sqlalchemy engine
model_groups (list): The list of model group ids we are interested in (ideally, chosen through audition)
- 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 check_entity_ids_in_files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_entity_ids_in_files(filenames, matrix_uuid):
"""Verifies if all the files in features and label have the same exact entity ids and knowledge dates"""
# get first 2 columns on each file (entity_id, knowledge_date)
for element in filenames:
logging.debug(f"getting entity id and knowledge date from features {element}")
- 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 _run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _run(self, bias_audit_config):
logger.spam("Validating bias audit configuration")
if not bias_audit_config:
# if empty, that's fine, shortcut out
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 colname_aggregate_lookup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def colname_aggregate_lookup(self):
"""A reverse lookup from column name to the source collate.Aggregate
Will error if the Aggregation contains duplicate column names
"""
- 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 stitch_csvs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def stitch_csvs(self, features_queries, label_query, matrix_store, matrix_uuid):
"""
Get all features related this matrix_uuid as CSV files, as well as the labels.
Join all the csv elements columnwise and create the final matrix.
The last column is the label.
- 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 column_imputation_lookup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def column_imputation_lookup(self, prefix=None):
"""
Args:
prefix: prefix for column names
Returns:
- 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 test_join_with_cohort_table
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_join_with_cohort_table(db_engine):
# if we specify joining with the cohort table
# only entity_id/date pairs in the cohort table should show up
db_engine.execute("create table events (entity_id int, date date, outcome bool)")
for event in events_data: