Showing 2,441 of 6,157 total issues
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__( # pylint: disable=too-many-arguments
Function formatTooltip
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
params: any,
xAxisLabel: string,
yAxisLabel: string,
sizeLabel: string,
xAxisFormatter: NumberFormatter,
Avoid deeply nested control flow statements. Open
if (pointRadiusUnit === 'Kilometers') {
pointLabel = `${roundDecimal(pointRadius, 2)}km`;
pointRadius = kmToPixels(pointRadius, pointLatitude, zoom);
} else if (pointRadiusUnit === 'Miles') {
pointLabel = `${roundDecimal(pointRadius, 2)}mi`;
Function displayHeaderCell
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
needToggle,
ArrowIcon,
onArrowClick,
value,
namesMapping,
Avoid deeply nested control flow statements. Open
if (value >= 0) {
continue;
}
Avoid deeply nested control flow statements. Open
if (n.children[j].weight / n.sum < partitionThreshold) {
break;
}
Avoid deeply nested control flow statements. Open
for (let x = xMin; x < xMax; x += period) {
xValues.push(x);
}
Avoid deeply nested control flow statements. Open
if (n.children[j].weight / n.sum < partitionThreshold) {
removeIndices.push(j);
}
Avoid deeply nested control flow statements. Open
if (clusterLabel >= 10000) {
clusterLabel = `${Math.round(clusterLabel / 1000)}k`;
} else if (clusterLabel >= 1000) {
clusterLabel = `${Math.round(clusterLabel / 100) / 10}k`;
}
Function handleChartDataResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function handleChartDataResponse(response, json, useLegacyApi) {
if (isFeatureEnabled(FeatureFlag.GlobalAsyncQueries)) {
// deal with getChartDataRequest transforming the response data
const result = 'result' in json ? json.result : json;
switch (response.status) {
- 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 exploreJSON
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
formData,
force = false,
timeout,
key,
dashboardId,
Function constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(adhocMetric) {
this.expressionType = adhocMetric.expressionType || EXPRESSION_TYPES.SIMPLE;
if (this.expressionType === EXPRESSION_TYPES.SIMPLE) {
// try to be clever in the case of transitioning from Sql expression back to simple expression
const inferredColumn = inferSqlExpressionColumn(adhocMetric);
- 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 runQueryFromSqlEditor
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
database,
queryEditor,
defaultQueryLimit,
tempTable,
ctas,
Function getComponentWidthFromDrop
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function getComponentWidthFromDrop({
dropResult,
layout: components,
}) {
const { source, destination, dragging } = dropResult;
- 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 postChartFormData
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
formData,
force = false,
timeout,
key,
dashboardId,
Function prepareCopyToClipboardTabularData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function prepareCopyToClipboardTabularData(data, columns) {
let result = columns.length
? `${columns.map(getColumnName).join('\t')}\n`
: '';
for (let i = 0; i < data.length; i += 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 main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def main(event_type: str, sha: str, repo: str) -> None:
"""Main function to check for file changes based on event context."""
print("SHA:", sha)
print("EVENT_TYPE", event_type)
if event_type == "pull_request":
- 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_docker_tags
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_docker_tags(
Function run_cypress_for_test_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def run_cypress_for_test_file(
Function findTopLevelComponentIds
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function findTopLevelComponentIds(layout) {
const topLevelNodes = [];
function recurseFromNode({
node,
- 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"