Geovation/photos

View on GitHub

Showing 138 of 138 total issues

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

  render() {
    // TODO add propTypes
    const { classes, theme, field} = this.props;

    const selectStyles = {
Severity: Minor
Found in src/components/PhotoPage/SelectControlMultipleValue.js - About 1 hr to fix

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

      render() {
        return (
          <Dialog
            fullScreen={false}
            open={this.props.open}
    Severity: Minor
    Found in src/components/LoginForm.js - About 1 hr to fix

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

                <Route
                  path={config.PAGES.about.path}
                  render={(props) => (
                    <AboutPage
                      {...props}
      Severity: Major
      Found in src/App.js and 1 other location - About 1 hr to fix
      src/App.js on lines 764..773

      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 64.

      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

                  <Route
                    path={config.PAGES.account.path}
                    render={(props) => (
                      <ProfilePage
                        {...props}
      Severity: Major
      Found in src/App.js and 1 other location - About 1 hr to fix
      src/App.js on lines 661..670

      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 64.

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

      async function processScheduledUpload(uploadItem) {
        uploadsProgress[uploadItem.id] = { ...uploadItem, progress: 0 };
        const { location, imgSrc, fieldsValues } = uploadItem;
      
        // upload it
      Severity: Minor
      Found in src/features/firebase/dbFirebase.js - About 1 hr to fix

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

          render() {
            // TODO add propTypes
            const { classes, theme, field} = this.props;
        
            const selectStyles = {
        Severity: Minor
        Found in src/components/PhotoPage/SelectControlSingleValue.js - About 1 hr to fix

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

            render() {
              const { field, classes } = this.props;
              const props = { ...this.props };
              props.handleChange = this.selectControlHandleChange;
          
          
          Severity: Minor
          Found in src/components/PhotoPage/SelectControlNumbered.js - About 1 hr to fix

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

            function Placeholder(props) {
              return (
                <Typography
                  color="textSecondary"
                  className={props.selectProps.classes.placeholder}
            Severity: Major
            Found in src/components/PhotoPage/SelectControlMultipleValue.js and 3 other locations - About 1 hr to fix
            src/components/PhotoPage/SelectControlMultipleValue.js on lines 74..84
            src/components/PhotoPage/SelectControlSingleValue.js on lines 77..87
            src/components/PhotoPage/SelectControlSingleValue.js on lines 128..138

            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 62.

            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 4 locations. Consider refactoring.
            Open

            function NoOptionsMessage(props) {
              return (
                <Typography
                  color="textSecondary"
                  className={props.selectProps.classes.noOptionsMessage}
            Severity: Major
            Found in src/components/PhotoPage/SelectControlSingleValue.js and 3 other locations - About 1 hr to fix
            src/components/PhotoPage/SelectControlMultipleValue.js on lines 74..84
            src/components/PhotoPage/SelectControlMultipleValue.js on lines 125..135
            src/components/PhotoPage/SelectControlSingleValue.js on lines 128..138

            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 62.

            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 4 locations. Consider refactoring.
            Open

            function Placeholder(props) {
              return (
                <Typography
                  color="textSecondary"
                  className={props.selectProps.classes.placeholder}
            Severity: Major
            Found in src/components/PhotoPage/SelectControlSingleValue.js and 3 other locations - About 1 hr to fix
            src/components/PhotoPage/SelectControlMultipleValue.js on lines 74..84
            src/components/PhotoPage/SelectControlMultipleValue.js on lines 125..135
            src/components/PhotoPage/SelectControlSingleValue.js on lines 77..87

            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 62.

            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 4 locations. Consider refactoring.
            Open

            function NoOptionsMessage(props) {
              return (
                <Typography
                  color="textSecondary"
                  className={props.selectProps.classes.noOptionsMessage}
            Severity: Major
            Found in src/components/PhotoPage/SelectControlMultipleValue.js and 3 other locations - About 1 hr to fix
            src/components/PhotoPage/SelectControlMultipleValue.js on lines 125..135
            src/components/PhotoPage/SelectControlSingleValue.js on lines 77..87
            src/components/PhotoPage/SelectControlSingleValue.js on lines 128..138

            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 62.

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

            async function run(num, storage, location) {
              console.log(`Will upload ${num} photos to ${storage} in ${location}`);
            
              admin.initializeApp({
                credential: admin.credential.cert(serviceAccount),
            Severity: Minor
            Found in scripts/populateDemoData.js - About 1 hr to fix

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

                    140: {
                      label: "Glass",
                      children: {
                        1065: {
                          label: "Glass Bottle"
              Severity: Major
              Found in src/custom/categories.js and 5 other locations - About 1 hr to fix
              src/custom/categories.js on lines 8..24
              src/custom/categories.js on lines 25..42
              src/custom/categories.js on lines 91..107
              src/custom/categories.js on lines 170..178
              src/custom/categories.js on lines 273..289

              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 61.

              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 removeFeature = (photo) => {
                  console.debug(`removing ${photo.id}`);
                  dispatch({ type: "DELETE_FEATURE", payload: { photo } });
                };
              Severity: Major
              Found in src/App.js and 1 other location - About 1 hr to fix
              src/App.js on lines 313..316

              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 61.

              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 6 locations. Consider refactoring.
              Open

                    119: {
                      label: "Fishing",
                      children: {
                        1007: {
                          label: "Fishing Line"
              Severity: Major
              Found in src/custom/categories.js and 5 other locations - About 1 hr to fix
              src/custom/categories.js on lines 8..24
              src/custom/categories.js on lines 25..42
              src/custom/categories.js on lines 170..178
              src/custom/categories.js on lines 273..289
              src/custom/categories.js on lines 438..452

              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 61.

              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 6 locations. Consider refactoring.
              Open

                    101: {
                      label: "Bags",
                      children: {
                        1000: {
                          label: "Plastic carrier bag (shopping / grocery bag)"
              Severity: Major
              Found in src/custom/categories.js and 5 other locations - About 1 hr to fix
              src/custom/categories.js on lines 25..42
              src/custom/categories.js on lines 91..107
              src/custom/categories.js on lines 170..178
              src/custom/categories.js on lines 273..289
              src/custom/categories.js on lines 438..452

              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 61.

              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 6 locations. Consider refactoring.
              Open

                    197: {
                      label: "Electrical",
                      children: {
                        1070: { label: "Mobile phone" },
                        1071: { label: "Headphone" },
              Severity: Major
              Found in src/custom/categories.js and 5 other locations - About 1 hr to fix
              src/custom/categories.js on lines 8..24
              src/custom/categories.js on lines 25..42
              src/custom/categories.js on lines 91..107
              src/custom/categories.js on lines 273..289
              src/custom/categories.js on lines 438..452

              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 61.

              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 modifyFeature = (photo) => {
                  console.debug(`modifying ${photo.id}`);
                  dispatch({ type: "UPDATE_FEATURE", payload: { photo } });
                };
              Severity: Major
              Found in src/App.js and 1 other location - About 1 hr to fix
              src/App.js on lines 323..326

              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 61.

              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 6 locations. Consider refactoring.
              Open

                    102: {
                      label: "Bottles and Containers",
                      children: {
                        1003: {
                          label: "Plastic drinks bottle"
              Severity: Major
              Found in src/custom/categories.js and 5 other locations - About 1 hr to fix
              src/custom/categories.js on lines 8..24
              src/custom/categories.js on lines 91..107
              src/custom/categories.js on lines 170..178
              src/custom/categories.js on lines 273..289
              src/custom/categories.js on lines 438..452

              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 61.

              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 6 locations. Consider refactoring.
              Open

                    134: {
                      label: "Medical",
                      children: {
                        1027: {
                          label: "Inhaler"
              Severity: Major
              Found in src/custom/categories.js and 5 other locations - About 1 hr to fix
              src/custom/categories.js on lines 8..24
              src/custom/categories.js on lines 25..42
              src/custom/categories.js on lines 91..107
              src/custom/categories.js on lines 170..178
              src/custom/categories.js on lines 438..452

              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 61.

              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