amaurymartiny/shoot-i-smoke

View on GitHub

Showing 27 of 27 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function getUser(expoPushToken: string): Promise<MongoUser> {
console.log(`[Axios]: GET /api/users/expoPushToken/${expoPushToken}`);
 
return axios
.get<MongoUser>(
Severity: Major
Found in App/util/axios.ts and 1 other location - About 5 hrs to fix
App/util/axios.ts on lines 86..100

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export function deleteUser(userId: string): Promise<MongoUser> {
console.log(`[Axios]: DELETE /api/users/${userId}`);
 
return axios
.delete<MongoUser>(
Severity: Major
Found in App/util/axios.ts and 1 other location - About 5 hrs to fix
App/util/axios.ts on lines 48..62

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<Text style={theme.text}>
{t('about_weird_results_message_1')}
<Text onPress={openWaqi} style={theme.link}>
{t('about_weird_results_link_1')}
</Text>
Severity: Major
Found in App/Screens/About/About.tsx and 1 other location - About 4 hrs to fix
App/Screens/About/About.tsx on lines 225..235

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<Text style={theme.text}>
{t('about_where_does_data_come_from_message_1')}
<Text onPress={openWaqi} style={theme.link}>
{t('about_where_does_data_come_from_link_1')}
</Text>
Severity: Major
Found in App/Screens/About/About.tsx and 1 other location - About 4 hrs to fix
App/Screens/About/About.tsx on lines 255..265

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<ScrollIntoView
onMount={route.params?.scrollInto === 'aboutBetaInaccurate'}
style={styles.section}
>
<Text style={styles.h2}>
Severity: Major
Found in App/Screens/About/About.tsx and 1 other location - About 3 hrs to fix
App/Screens/About/About.tsx on lines 238..251

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<ScrollIntoView
onMount={
route.params?.scrollInto ===
'aboutWhyIsTheStationSoFarTitle'
}
Severity: Major
Found in App/Screens/About/About.tsx and 1 other location - About 3 hrs to fix
App/Screens/About/About.tsx on lines 209..219

File About.tsx has 298 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Shoot! I Smoke
// Copyright (C) 2018-2023 Marcelo S. Coelho, Amaury M.
 
// Shoot! I Smoke is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Severity: Minor
Found in App/Screens/About/About.tsx - About 3 hrs to fix

    Function SelectNotifications has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    export function SelectNotifications(
    props: SelectNotificationsProps
    ): React.ReactElement {
    const { style, ...rest } = props;
    const { api } = useContext(ApiContext);
    Severity: Minor
    Found in App/Screens/Home/Footer/SelectNotifications/SelectNotifications.tsx - About 2 hrs to fix

    Function Search has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    export function Search(props: SearchProps): React.ReactElement {
    const {
    navigation: { goBack },
    } = props;
     
     
    Severity: Minor
    Found in App/Screens/Search/Search.tsx - About 2 hrs to fix

    Function getCigarettesHeight has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function getCigarettesHeight(count: number): number {
    return scale(
    count <= THRESHOLD.FIRST
    ? SIZES.BIG
    : count <= THRESHOLD.SECOND
    Severity: Minor
    Found in App/Screens/Home/Home.tsx - About 1 hr to fix

    Function Cigarettes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export function Cigarettes(props: CigarettesProps): React.ReactElement {
    const {
    cigarettes: realCigarettes,
    cigaretteStyle,
    fullCigaretteLength = 90,
    Severity: Minor
    Found in App/components/Cigarettes/Cigarettes.tsx - About 1 hr to fix

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    type700: {
    fontFamily: Montserrat800,
    fontSize: scale(48),
    fontWeight: '800' as const,
    lineHeight: scale(54),
    Severity: Major
    Found in App/util/theme.ts and 3 other locations - About 50 mins to fix
    App/util/theme.ts on lines 54..60
    App/util/theme.ts on lines 61..67
    App/util/theme.ts on lines 68..74

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    type600: {
    fontFamily: Montserrat800,
    fontSize: scale(36),
    fontWeight: '800' as const,
    lineHeight: scale(42),
    Severity: Major
    Found in App/util/theme.ts and 3 other locations - About 50 mins to fix
    App/util/theme.ts on lines 47..53
    App/util/theme.ts on lines 61..67
    App/util/theme.ts on lines 68..74

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    type500: {
    fontFamily: Montserrat800,
    fontSize: scale(24),
    fontWeight: '800' as const,
    lineHeight: scale(28),
    Severity: Major
    Found in App/util/theme.ts and 3 other locations - About 50 mins to fix
    App/util/theme.ts on lines 47..53
    App/util/theme.ts on lines 54..60
    App/util/theme.ts on lines 68..74

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    type400: {
    fontFamily: Montserrat800,
    fontSize: scale(18),
    fontWeight: '800' as const,
    lineHeight: scale(21.94),
    Severity: Major
    Found in App/util/theme.ts and 3 other locations - About 50 mins to fix
    App/util/theme.ts on lines 47..53
    App/util/theme.ts on lines 54..60
    App/util/theme.ts on lines 61..67

    Function renderEmptyList has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    GeoapifyError: Error | undefined,
    hits: GeoapifyRes[],
    loading: boolean,
    search: string,
    isGps: boolean
    Severity: Minor
    Found in App/Screens/Search/Search.tsx - About 35 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      <View style={styles.tag}>
      <Text style={styles.tagLabel}>BETA</Text>
      </View>
      Severity: Minor
      Found in App/Screens/Home/AdditionalInfo/AdditionalInfo.tsx and 1 other location - About 35 mins to fix
      App/components/ConversionBox/ConversionBox.tsx on lines 133..136

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      <Text style={styles.label}>
      <Text style={styles.micro}>&micro;</Text>
      g/m&sup3; PM2.5*
      </Text>
      Severity: Minor
      Found in App/components/ConversionBox/ConversionBox.tsx and 1 other location - About 35 mins to fix
      App/Screens/Home/AdditionalInfo/AdditionalInfo.tsx on lines 110..112

      Function Button has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export function Button(props: ButtonProps): React.ReactElement {
      const {
      as: Wrapper = TouchableOpacity,
      children,
      onPress,
      Severity: Minor
      Found in App/components/Button/Button.tsx - About 35 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      distance: {
      borderTopColor: theme.iconBackgroundColor,
      borderTopWidth: 1,
      marginBottom: theme.spacing.big,
      paddingTop: theme.spacing.big,
      Severity: Minor
      Found in App/Screens/About/About.tsx and 1 other location - About 35 mins to fix
      App/Screens/About/About.tsx on lines 112..117
      Severity
      Category
      Status
      Source
      Language