Showing 438 of 1,408 total issues
Function fix_invalid_geometries
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fix_invalid_geometries(gdf):
"""
Identify and fix invalid geometries in a GeoDataFrame.
Parameters:
- 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 storeToQueryParams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const storeToQueryParams = ({
startYear,
indicators,
materials,
businessUnits,
- 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 ScenariosComponent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const ScenariosComponent: React.FC<{ scrollref?: MutableRefObject<HTMLDivElement> }> = ({
scrollref,
}) => {
const { query, push } = useRouter();
const { scenarioId = ACTUAL_DATA.id } = query;
- 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 UserForm
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const UserForm = ({ user, onSubmit, children }: UserFormProps) => {
const roleOptions = Object.values(RoleName).map((role) => ({ label: role, value: role }));
const {
register,
- 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 saveListToTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public async saveListToTree(
importData: CreateDto[],
pathKey: keyof CreateDto,
): Promise<Entity[]> {
let rest: (CreateDto & WithExplodedPath)[] = importData.map(
- 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 parseTime
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function parseTime(input: string | Date | undefined): Date | undefined {
if (input != null) {
if (input instanceof Date) {
return input;
}
- 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 _getHighlightedObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private _getHighlightedObject(info: Record<string, any>): HighlightedObject | undefined {
const { index, sourceLayer } = info;
if (index < 0) return undefined;
if (sourceLayer instanceof FlowLinesLayer || sourceLayer instanceof AnimatedFlowLinesLayer) {
const { lineAttributes } = this.state?.layersData || {};
- 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 getColors
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
diffMode: boolean,
schemeKey: string | undefined,
darkMode: boolean,
fadeEnabled: boolean,
fadeAmount: number,
Function insert_in_contextuals_table
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_in_contextuals_table(name, category, metadata, tiler_url, default_params=None) -> str:
Function insert_h3_grid_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_h3_grid_data(
Function createCluster
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
x: number,
y: number,
id: number,
numPoints: number,
weight: number,
Function SignIn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SignIn: NextPageWithLayout = () => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const router = useRouter();
const {
- 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 AnalysisDynamicMetadata
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const AnalysisDynamicMetadata: FC<AnalysisDynamicMetadataTypes> = ({
className,
}: AnalysisDynamicMetadataTypes) => {
const searchParams = useSearchParams();
const isComparisonEnabled = Boolean(searchParams.get('compareScenarioId'));
- 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 DownloadMaterialsDataButton
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const DownloadMaterialsDataButton: React.FC = () => {
const [isDownloading, setIsDownloading] = useState<boolean>(false);
const {
data: sourcingLocations,
- 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 MaterialSettings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const MaterialSettings = ({
layer,
onChangeMaterial,
onChange,
materialId,
- 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 getUserFullName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const getUserFullName = (user: User, options?: { replaceByEmail?: boolean }) => {
if (!user) return '';
const { fname, lname, email } = user;
let name = '';
if (fname) {
- 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 filterTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const filterTree = <T extends HasChildren<T>>(
tree: T,
filter: (node: T) => boolean,
depth = 0,
): T | null => {
- 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 ImpactLayer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ImpactLayer = () => {
const searchParams = useSearchParams();
const isComparisonEnabled = Boolean(searchParams.get('compareScenarioId'));
const dispatch = useAppDispatch();
- 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 vector_file_to_h3dataframe
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def vector_file_to_h3dataframe(
filename: Path,
column: str,
h3_res: int = 6,
layer: Union[str, None] = 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 ScenarioItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ScenarioItem = ({ scenario, isSelected }: ScenariosItemProps) => {
const updatedAt = useMemo(
() => (scenario.updatedAt ? new Date(scenario.updatedAt) : null),
[scenario.updatedAt],
);
- 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"