jfilter/frag-den-staat-app

View on GitHub

Showing 41 of 110 total issues

File index.js has 563 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  ActivityIndicator,
  Linking,
  Platform,
  Share,
Severity: Major
Found in src/components/screens/FoiRequestDetails/index.js - About 1 day to fix

    Function render has 199 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {
          navigateToAboutApp,
          navigateToAboutFOIMaster,
          navigateToFAQ,
    Severity: Major
    Found in src/containers/profile/ProfileStartScreen.js - About 7 hrs to fix

      Function render has 143 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const {
            filterChange,
            currentUserId,
            currentUserFilter,
      Severity: Major
      Found in src/containers/foiRequests/FoiRequestsDrawer.js - About 5 hrs to fix

        Function render has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { clampedScroll } = this.state;
        
            const headerTranslate = clampedScroll.interpolate({
              inputRange: [0, LIST_HEADER_HEIGHT],
        Severity: Major
        Found in src/containers/foiRequests/FoiRequestsMasterScreen.js - About 3 hrs to fix

          File FoiRequestsMasterScreen.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            Alert,
            Animated,
            FlatList,
            Platform,
          Severity: Minor
          Found in src/containers/foiRequests/FoiRequestsMasterScreen.js - About 3 hrs to fix

            Function render has 80 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const { title, description, letterEnd, letterStart, anon } = this.state;
                const { publicBody } = this.props.navigation.state.params;
            
                const mainElements = (
            Severity: Major
            Found in src/containers/newRequest/NewRequestWriteScreen.js - About 3 hrs to fix

              Function render has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const { filter, updateFilter } = this.props;
              
                  // special tab for public body, somehwat hacky
                  const publicBodyTab = filter.publicBody && (
              Severity: Major
              Found in src/containers/foiRequests/FoiRequestsListHeader.js - About 3 hrs to fix

                Function search has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function search(state = initialState, action) {
                  switch (action.type) {
                    case 'SEARCH_FOI_REQUESTS_ERROR':
                      return {
                        ...state,
                Severity: Major
                Found in src/reducers/search.js - About 3 hrs to fix

                  Function render has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const cta = (
                        <View style={{ width: '97%' }}>
                          <Text style={styles.text}>
                            {`Sieh' dir die Anfragen von anderen Personen an oder erfahr' erst mehr über Informationsfreiheit in unserem kurzen Video.
                  Severity: Major
                  Found in src/containers/foiRequests/FoiRequestsOnboardingScreen.js - About 2 hrs to fix

                    Function foiRequests has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function foiRequests(state = initialState, action) {
                      switch (action.type) {
                        case 'FOI_REQUESTS_ERROR':
                          return {
                            ...state,
                    Severity: Major
                    Found in src/reducers/foiRequests.js - About 2 hrs to fix

                      Function buildUrl has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function buildUrl(getState) {
                        const state = getState();
                        const { filter, nPage, isRefreshing, campaign } = state.foiRequests;
                      
                        let offset = FOI_REQUESTS_PAGE_SIZE * nPage;
                      Severity: Minor
                      Found in src/actions/foiRequests.js - About 2 hrs to fix

                      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 render has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const {
                            title,
                            description,
                            publicBody,
                      Severity: Major
                      Found in src/containers/newRequest/NewRequestConfirmScreen.js - About 2 hrs to fix

                        Function render has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          render() {
                            const {
                              pastAlertMatches,
                              alerts,
                              hasNotificationPermission,
                        Severity: Major
                        Found in src/navigators/ReduxNavigation.js - About 2 hrs to fix

                          Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            render() {
                              const { title, public_body: publicBody, description } = this.props.request;
                              let subheading = (
                                <SubHeading style={styles.subheading}>
                                  {I18n.t('foiRequestDetails.notYetSpecified')}
                          Severity: Major
                          Found in src/components/screens/FoiRequestDetails/index.js - About 2 hrs to fix

                            File ProfileStartScreen.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { Linking, Platform } from 'react-native';
                            import { ListItem } from 'react-native-elements';
                            import { NavigationActions } from 'react-navigation';
                            import { connect } from 'react-redux';
                            import React from 'react';
                            Severity: Minor
                            Found in src/containers/profile/ProfileStartScreen.js - About 2 hrs to fix

                              Function render has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                render() {
                                  const size = Platform.OS === 'ios' ? 35 : 26; // for icon
                                  const { currentUserId, navigateToLogin } = this.props;
                                  const { search } = this.state;
                                  return (
                              Severity: Major
                              Found in src/containers/newRequest/NewRequestStartScreen.js - About 2 hrs to fix

                                Function authentication has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function authentication(state = initialState, action) {
                                  switch (action.type) {
                                    case 'OAUTH_UPDATE_TOKEN':
                                      return {
                                        ...state,
                                Severity: Minor
                                Found in src/reducers/authentication.js - About 1 hr to fix

                                  Function buildUrl has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function buildUrl(getState) {
                                    const state = getState();
                                    const { filter, nPage, isRefreshing, campaign } = state.foiRequests;
                                  
                                    let offset = FOI_REQUESTS_PAGE_SIZE * nPage;
                                  Severity: Minor
                                  Found in src/actions/foiRequests.js - About 1 hr to fix

                                    Function render has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      render() {
                                        const {
                                          filterChange,
                                          currentUserId,
                                          currentUserFilter,
                                    Severity: Minor
                                    Found in src/containers/foiRequests/FoiRequestsDrawer.js - About 1 hr to fix

                                    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 toggleFollow has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      async toggleFollow() {
                                        try {
                                          const {
                                            id,
                                            getAccessToken,
                                    Severity: Minor
                                    Found in src/containers/foiRequests/FollowingIcon.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language