Showing 2,441 of 6,157 total issues
Consider simplifying this complex logical expression. Open
if (
(origCol.isMetric || origCol.isPercentMetric) &&
!origCol.key.includes(comparisonSuffix) &&
origCol.isNumeric
) {
Consider simplifying this complex logical expression. Open
if (
(origCol.isMetric || origCol.isPercentMetric) &&
!origCol.key.includes(ensureIsArray(timeOffsets)[0]) &&
origCol.isNumeric
) {
Consider simplifying this complex logical expression. Open
if (
section.tabOverride === 'data' ||
section.controlSetRows.some(rows =>
rows.some(
control =>
Consider simplifying this complex logical expression. Open
} else if (!isEmpty(shifts) || startDate) {
let useStartDate = startDate;
if (!startDate && !isEmpty(previousCustomFilter)) {
useStartDate = previousCustomFilter[0]?.comparator.split(' : ')[0];
useStartDate = moment(parseDttmToDate(useStartDate)).format(
Function useListViewResource
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
resource: string,
resourceLabel: string, // resourceLabel for translations
handleErrorMsg: (errorMsg: string) => void,
infoEnable = true,
defaultCollectionValue: D[] = [],
Consider simplifying this complex logical expression. Open
if (
cachedNativeIndicatorsForChart[chartId] &&
areObjectsEqual(cachedFilterData?.appliedColumns, appliedColumns) &&
areObjectsEqual(cachedFilterData?.rejectedColumns, rejectedColumns) &&
cachedFilterData?.nativeFilters === nativeFilters &&
Consider simplifying this complex logical expression. Open
if (!!setting.method && setting.method === 'Email') {
return (
(!setting.recipients?.length || validateEmails(setting.recipients)) &&
(!setting.cc || validateEmails(setting.cc)) &&
(!setting.bcc || validateEmails(setting.bcc))
Function createTime
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
mode: 'local' | 'utc',
year: number,
month = 0,
date = 1,
hours = 0,
Consider simplifying this complex logical expression. Open
if (
errorJson &&
('error' in errorJson || 'message' in errorJson || 'errors' in errorJson)
) {
let err;
Consider simplifying this complex logical expression. Open
if (
metrics.length === 1 &&
columns.length > 0 &&
xAxisLabel &&
!(
Function getBasePivotSettings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getBasePivotSettings() {
// One-time extraction of pivot settings that we'll use throughout the render.
const { props } = this;
const colAttrs = props.cols;
- 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 updateHistory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async (
formData,
datasourceId,
datasourceType,
isReplace,
- 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 onChange
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
onChange() {
const { type } = this.state;
const value = { type };
const errors = [];
const errMsg = t('Invalid lat/long configuration.');
- 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 renderEditor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
renderEditor(inModal = false) {
const minLines = inModal ? 40 : this.props.minLines || 12;
if (this.props.language) {
const style = {
border: `1px solid ${this.props.theme.colors.grayscale.light1}`,
- 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 verify_rsa_key
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def verify_rsa_key(rsa_key: str, email: Optional[str]) -> str:
"""Fetch the KEYS file and verify if the RSA key and email match."""
url = "https://downloads.apache.org/superset/KEYS"
response = requests.get(url)
if response.status_code == 200:
- 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 load_random_time_series_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_random_time_series_data(
only_metadata: bool = False, force: bool = False
) -> None:
"""Loading random time series data from a zip file in the repo"""
tbl_name = "random_time_series"
- 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 __repr__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __repr__(self) -> str:
result = f"\n{self._get_changelog_version_head()}\n"
changelog = {
"Database Migrations": "\n",
"Features": "\n",
- 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 upgrade
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def upgrade():
bind = op.get_bind()
session: Session = db.Session(bind=bind)
truncated_count = 0
for entry in paginated_update(
- 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 upgrade
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
for slc in session.query(Slice).all():
- 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 paginated_update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def paginated_update(
query: Query,
print_page_progress: Optional[Union[Callable[[int, int], None], bool]] = None,
batch_size: int = DEFAULT_BATCH_SIZE,
) -> Iterator[Any]:
- 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"