jfilter/frag-den-staat-app

View on GitHub

Showing 110 of 110 total issues

Identical blocks of code found in 3 locations. Consider refactoring.
Open

  function share() {
    Share.share(
      {
        ...Platform.select({
          ios: {
Severity: Major
Found in src/components/foiRequests/WebView/index.js and 2 other locations - About 3 hrs to fix
src/components/screens/FoiRequestDetails/index.js on lines 514..536
src/components/screens/PdfViewer/index.js on lines 58..80

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 3 locations. Consider refactoring.
Open

  function share() {
    Share.share(
      {
        ...Platform.select({
          ios: {
Severity: Major
Found in src/components/screens/PdfViewer/index.js and 2 other locations - About 3 hrs to fix
src/components/foiRequests/WebView/index.js on lines 14..36
src/components/screens/FoiRequestDetails/index.js on lines 514..536

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

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

            <View style={tableStyles.row}>
              <Text style={tableStyles.item1}>
                {I18n.t('foiRequestDetails.subject')}
              </Text>
              <Text selectable style={tableStyles.item2}>
    Severity: Major
    Found in src/components/screens/FoiRequestDetails/index.js and 1 other location - About 2 hrs to fix
    src/components/screens/FoiRequestDetails/index.js on lines 185..192

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 94.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            <View style={tableStyles.row}>
              <Text style={tableStyles.item1}>
                {I18n.t('foiRequestDetails.from')}
              </Text>
              <Text selectable style={tableStyles.item2}>
    Severity: Major
    Found in src/components/screens/FoiRequestDetails/index.js and 1 other location - About 2 hrs to fix
    src/components/screens/FoiRequestDetails/index.js on lines 202..209

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 94.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    const SearchFoiRequestDetails = ({
      request,
      messages,
      fetchSingleFoiRequest,
      navigateToPdfViewer,
    Severity: Major
    Found in src/containers/search/SearchFoiRequestDetailsScreen.js and 1 other location - About 2 hrs to fix
    src/containers/foiRequests/FoiRequestsDetailsScreen.js on lines 9..25

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 92.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    const FoiRequestsDetailsScreen = ({
      request,
      messages,
      fetchSingleFoiRequest,
      navigateToPdfViewer,
    Severity: Major
    Found in src/containers/foiRequests/FoiRequestsDetailsScreen.js and 1 other location - About 2 hrs to fix
    src/containers/search/SearchFoiRequestDetailsScreen.js on lines 13..29

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 92.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            <ListItem
              containerStyle={styles.listItemContainer}
              leftIcon={{
                name: 'facebook-box',
                type: 'material-community',
    Severity: Major
    Found in src/containers/profile/ProfileStartScreen.js and 1 other location - About 2 hrs to fix
    src/containers/profile/ProfileStartScreen.js on lines 193..203

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 92.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            <ListItem
              containerStyle={styles.listItemContainer}
              leftIcon={{
                name: 'twitter-box',
                type: 'material-community',
    Severity: Major
    Found in src/containers/profile/ProfileStartScreen.js and 1 other location - About 2 hrs to fix
    src/containers/profile/ProfileStartScreen.js on lines 204..216

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 92.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

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

            function fetchPublicBody(publicBodyId) {
              return dispatch => {
                const buildUrl = () => `${ORIGIN}${PUBLIC_BODIES_PATH}${publicBodyId}`;
            
                const onSuccess = (innerDispatch => data =>
            Severity: Major
            Found in src/actions/publicBodies.js and 1 other location - About 2 hrs to fix
            src/actions/singleFoiRequest.js on lines 21..36

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 83.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            function fetchSingleFoiRequest(foiRequestId) {
              return dispatch => {
                const buildUrl = () => `${ORIGIN}${FOI_REQUESTS_PATH}${foiRequestId}`;
            
                const onSuccess = (innerDispatch => data =>
            Severity: Major
            Found in src/actions/singleFoiRequest.js and 1 other location - About 2 hrs to fix
            src/actions/publicBodies.js on lines 24..39

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 83.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

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

              const mapDispatchToProps = dispatch => {
                return {
                  clearError: () => dispatch(searchFoiRequestsErrorClearAction()),
                  doSearch: () => dispatch(searchFoiRequests()),
                  navigateToSingle: params =>
              src/containers/search/SearchResultsPublicBodiesMasterScreen.js on lines 72..84

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 79.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                {
                  SearchStart: { screen: SearchStartScreen },
                  SearchResults: { screen: SearchResultsNavigator },
                  SearchFoiRequestDetails: { screen: SearchFoiRequestDetailsScreen },
                  SearchPublicBodyDetails: { screen: SearchPublicBodyDetailsScreen },
              Severity: Major
              Found in src/navigators/SearchNavigator.js and 1 other location - About 2 hrs to fix
              src/navigators/FoiRequestsNavigator.js on lines 17..25

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 79.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                {
                  FoiRequestsMaster: { screen: FoiRequestsMasterScreen },
                  FoiRequestsDetails: { screen: FoiRequestsDetailsScreen },
                  FoiRequestsPdfViewer: { screen: PdfViewer },
                  FoiRequestsPublicBody: { screen: FoiRequestsPublicBodyScreen },
              Severity: Major
              Found in src/navigators/FoiRequestsNavigator.js and 1 other location - About 2 hrs to fix
              src/navigators/SearchNavigator.js on lines 46..54

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 79.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language