Showing 156 of 190 total issues
Function PoisDesktop
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const PoisDesktop = ({
panelHeights,
toolbar,
data,
userLocation,
- 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 navigateToLink
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const navigateToLink = <T extends RoutesType>(
url: string,
navigation: NavigationProps<T>,
languageCode: string,
navigateTo: (routeInformation: RouteInformationType) => void,
Function loadCategories
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async loadCategories(context: DatabaseContext): Promise<CategoriesMapModel> {
const path = this.getContentPath('categories', context)
const mapCategoriesJson = (json: ContentCategoryJsonType[]) =>
new CategoriesMapModel(
json.map(
Function createJsonLd
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createJsonLd = (event: EventModel): WithContext<Event> | null => {
if (!event.location) {
return null
}
const date = event.date
Function fixBounds
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private fixBounds(
viewWidth: number,
viewHeight: number,
realImageWidth: number,
realImageHeight: number,
Function Consent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Consent = (): ReactElement | null => {
const { settings, updateSettings } = useAppContext()
const { t } = useTranslation('consent')
const { externalSourcePermissions } = settings
Function pathnameFromRouteInformation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const pathnameFromRouteInformation = (routeInformation: NonNullableRouteInformationType): string => {
if (
routeInformation.route === JPAL_TRACKING_ROUTE ||
routeInformation.route === LICENSES_ROUTE ||
routeInformation.route === CONSENT_ROUTE
- 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 createTrackingEndpoint
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const createTrackingEndpoint = (url: string = JPAL_TRACKING_ENDPOINT_URL): TrackingEndpointType => {
const request = async (signal: SignalType) => {
const pageType = signal.name === OPEN_PAGE_SIGNAL_NAME ? signal.pageType : undefined
const signalUrl =
signal.name !== SEND_FEEDBACK_SIGNAL_NAME &&
- 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 fetchAsync
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
func fetchAsync(sourceUrl: String, targetFilePath: String, collector: FetchResultCollector) {
let targetFileURL = URL(fileURLWithPath: targetFilePath)
let fileManager = FileManager.default
- 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 Intro
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const Intro = ({ route, navigation }: IntroProps): ReactElement => {
const { updateSettings } = useContext(AppContext)
const [currentSlide, setCurrentSlide] = useState(0)
const { width } = useWindowDimensions()
const { t } = useTranslation<['intro', 'settings']>(['intro', 'settings'])
- 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 useUserLocation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const useUserLocation = ({ requestPermissionInitially }: UseUserLocationProps): UseUserLocationReturn => {
const [locationState, setLocationState] = useState<LocationStateType>(initialState)
const showSnackbar = useSnackbar()
const { t } = useTranslation()
- 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 queryStringFromRouteInformation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const queryStringFromRouteInformation = (
routeInformation: NonNullableRouteInformationType,
): string | undefined => {
const queryParams = []
if (routeInformation.route === POIS_ROUTE) {
- 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 loadWithCache
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const loadWithCache = async <T extends object>({
cityCode,
languageCode,
isAvailable,
getFromDataContainer,
- 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 SettingItem
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SettingItem = (props: SettingItemProps): ReactElement => {
const { title, description, onPress, value, hasBadge, hasSwitch, bigTitle, role } = props
const { t } = useTranslation('settings')
return (
Function buildConfigAssets
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const buildConfigAssets = (): AssetsType => {
const assetsName = buildConfig().assets
if (assetsName === INTEGREAT_ASSETS) {
return {
Function LanguageSelector
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LanguageSelector = (props: LanguageSelectorProps): ReactElement => {
const { isHeaderActionItem, languageChangePaths, languageCode, inKebabMenu = false, closeSidebar } = props
const activeItemCode = languageCode
const { t } = useTranslation('layout')
Function formatDevelopmentNotes
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const formatDevelopmentNotes = (params: { notes: NoteType[]; language: string; platforms: string[] }) => {
const { notes, language, platforms } = params
const emptyNotesMap = {
common: [] as NoteType[],
android: [] as NoteType[],
Function handleSubmit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const handleSubmit = () => {
setSendingStatus('sending')
const request = async () => {
const feedbackEndpoint = createFeedbackEndpoint(await determineApiUrl())
Function toICal
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
toICal(baseUrl: string, appName: string, recurring: boolean): string {
const { title, location, path, date, excerpt, lastUpdate } = this
const url = `${baseUrl}${path}`
const uid = v5(`${url}/${formatDateICal(lastUpdate)}`, v5.URL)
const timezone = date.startDate.zone.name
Function storeCategories
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async storeCategories(categoriesMap: CategoriesMapModel, context: DatabaseContext): Promise<void> {
const categoryModels = categoriesMap.toArray()
const jsonModels = categoryModels.map(
(category: CategoryModel): ContentCategoryJsonType => ({
root: category.isRoot(),