Showing 230 of 3,856 total issues
Avoid too many return
statements within this function. Open
return self._udf(metric or x) # type: ignore
Avoid too many return
statements within this function. Open
return Predicate(Relation.neq, value, component=component), i
Avoid too many return
statements within this function. Open
return result
Avoid too many return
statements within this function. Open
return lambda x: x <= value # type: ignore
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return x <= value
Avoid too many return
statements within this function. Open
return lambda x: x > value # type: ignore
Avoid too many return
statements within this function. Open
return result
Avoid too many return
statements within this function. Open
return Predicate(Relation._and, left=left, right=right, component=left._component), i
Avoid too many return
statements within this function. Open
return PreprocessedColumn.apply(list_format)
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return x != value
Avoid too many return
statements within this function. Open
return not self._right(metric or x) # type: ignore
Method resolve
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public HashMap<String, Metric<?>> resolve(ColumnSchema schema) {
HashMap<String, Metric<?>> resolvedMetrics = new HashMap<>();
if (DataTypes.Integral.includes(schema.getType())) {
- 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 is_k_item_relevant
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_k_item_relevant(self, row: pd.core.series.Series, k: int) -> int:
if self.convert_non_numeric:
return 1 if row[self.prediction_column][k - 1] in row[self.target_column] else 0
else:
index_ki = row[self.prediction_column].index(k)
- 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 register_dataset_udf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def register_dataset_udf(
col_names: List[str],
udf_name: Optional[str] = None,
metrics: Optional[List[MetricSpec]] = None,
namespace: Optional[str] = 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
Method merge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Override
public T merge(T lhs, T rhs) throws UnsupportedError {
if (lhs instanceof Double) {
Double result = lhs.doubleValue() + rhs.doubleValue();
return (T) result;
- 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 truncate_time_ms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def truncate_time_ms(t: int, granularity: TimeGranularity) -> int:
dt = datetime.fromtimestamp(t / 1000, tz=tz.tzutc()).replace(second=0, microsecond=0)
if granularity == TimeGranularity.Minute:
trunc = dt
- 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 get_result_set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_result_set(self, dataset_timestamp: Optional[datetime]) -> SegmentedResultSet:
segmented_profiles: Dict[str, Dict[Segment, DatasetProfile]] = dict()
for segment_key in self._cache:
segments = segmented_profiles.get(segment_key.parent_id)
if segments is 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 sum_gains
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sum_gains(self, row: pd.core.series.Series, k: int) -> int:
if self.convert_non_numeric:
return sum(
[1 if pred_val in row[self.target_column] else 0 for pred_val in row[self.prediction_column][:k]]
)
- 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"