imaginerio/narratives

View on GitHub

Showing 79 of 86 total issues

Function Signup has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Signup = () => {
  const {
    createAccount,
    enterDetails,
    name,
Severity: Major
Found in src/pages/signup.js - About 5 hrs to fix

    File [project].js has 330 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable jsx-a11y/label-has-associated-control */
    import React, { useState, useEffect } from 'react';
    import PropTypes from 'prop-types';
    import { useQuery, useMutation, gql } from '@apollo/client';
    import { map } from 'lodash';
    Severity: Minor
    Found in src/pages/project/[project].js - About 3 hrs to fix

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

                <button
                  className={styles.button}
                  style={{ backgroundColor: modeId === 'drawPolygon' ? '#ccc' : null }}
                  type="button"
                  tabIndex={-1}
      Severity: Major
      Found in src/components/Toolbar/index.jsx and 2 other locations - About 3 hrs to fix
      src/components/Toolbar/index.jsx on lines 28..37
      src/components/Toolbar/index.jsx on lines 48..57

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

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

                <button
                  className={styles.button}
                  style={{ backgroundColor: modeId === 'drawPoint' ? '#ccc' : null }}
                  type="button"
                  tabIndex={-1}
      Severity: Major
      Found in src/components/Toolbar/index.jsx and 2 other locations - About 3 hrs to fix
      src/components/Toolbar/index.jsx on lines 28..37
      src/components/Toolbar/index.jsx on lines 38..47

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

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

                <button
                  className={styles.button}
                  style={{ backgroundColor: modeId === 'drawPolyline' ? '#ccc' : null }}
                  type="button"
                  tabIndex={-1}
      Severity: Major
      Found in src/components/Toolbar/index.jsx and 2 other locations - About 3 hrs to fix
      src/components/Toolbar/index.jsx on lines 38..47
      src/components/Toolbar/index.jsx on lines 48..57

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

      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 index.jsx has 315 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable jsx-a11y/click-events-have-key-events */
      import React, { useEffect, useRef, useState } from 'react';
      import PropTypes from 'prop-types';
      import ReactMapGL, {
        Source,
      Severity: Minor
      Found in src/components/Atlas/index.jsx - About 3 hrs to fix

        Function Login has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const Login = () => {
          const { locale } = useRouter();
          const { welcome, loginFull, email, password, loginError, verifyError, login, forgot } =
            useLocale();
        
        
        Severity: Major
        Found in src/pages/login.js - About 3 hrs to fix

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

                        <Form.Input
                          required
                          name="password"
                          label={password}
                          type="password"
          Severity: Major
          Found in src/pages/signup.js and 2 other locations - About 3 hrs to fix
          src/pages/signup.js on lines 104..112
          src/pages/signup.js on lines 113..121

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

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

                      <Form.Input
                        required
                        name="name"
                        label={name}
                        type="text"
          Severity: Major
          Found in src/pages/signup.js and 2 other locations - About 3 hrs to fix
          src/pages/signup.js on lines 113..121
          src/pages/signup.js on lines 141..149

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

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

                      <Form.Input
                        required
                        name="email"
                        label={email}
                        type="email"
          Severity: Major
          Found in src/pages/signup.js and 2 other locations - About 3 hrs to fix
          src/pages/signup.js on lines 104..112
          src/pages/signup.js on lines 141..149

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

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

            prepareMiddleware({ keystone }) {
              const middleware = express();
              middleware.get('/download', (req, res) =>
                runCustomQuery({
                  keystone,
          Severity: Major
          Found in routes/download.js - About 2 hrs to fix

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

              const {
                data: { data },
              } = await axios.post(`${req.protocol}://${req.get('Host')}/admin/api`, {
                query: `query GetProjectDetails($project: ID!) {
                    project: Project(where: { id: $project }) {
            Severity: Major
            Found in src/pages/details/[project].js and 3 other locations - About 2 hrs to fix
            src/pages/user/reset/[key].js on lines 102..113
            src/pages/user/verify/[key].js on lines 44..55
            src/pages/view/[project].js on lines 22..72

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

            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

              const {
                data: { data },
              } = await axios.post(`${req.protocol}://${req.get('Host')}/admin/api`, {
                query: `query GetFullProject($project: ID!) {
                    Project(where: { id: $project }) {
            Severity: Major
            Found in src/pages/view/[project].js and 3 other locations - About 2 hrs to fix
            src/pages/details/[project].js on lines 103..128
            src/pages/user/reset/[key].js on lines 102..113
            src/pages/user/verify/[key].js on lines 44..55

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

            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

              const {
                data: { data },
              } = await axios.post(`${req.protocol}://${req.get('Host')}/admin/api`, {
                query: `query GetReset($key: String){
                  allUsers(where: { resetId: $key }){
            Severity: Major
            Found in src/pages/user/reset/[key].js and 3 other locations - About 2 hrs to fix
            src/pages/details/[project].js on lines 103..128
            src/pages/user/verify/[key].js on lines 44..55
            src/pages/view/[project].js on lines 22..72

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

            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

              const {
                data: { data },
              } = await axios.post(`${req.protocol}://${req.get('Host')}/admin/api`, {
                query: `query GetVerification($key: String){
                  allUsers(where: { verifyId: $key }){
            Severity: Major
            Found in src/pages/user/verify/[key].js and 3 other locations - About 2 hrs to fix
            src/pages/details/[project].js on lines 103..128
            src/pages/user/reset/[key].js on lines 102..113
            src/pages/view/[project].js on lines 22..72

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

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

            export default function Toolbar() {
              const [{ editing, modeId }, dispatch] = useDraw();
            
              return (
                <div
            Severity: Major
            Found in src/components/Toolbar/index.jsx - About 2 hrs to fix

              Function prepareMiddleware has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                prepareMiddleware({ keystone }) {
                  const middleware = express();
                  middleware.get('/duplicate/:id', (req, res) =>
                    runCustomQuery({
                      keystone,
              Severity: Major
              Found in routes/duplicate.js - About 2 hrs to fix

                Function Reset has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Reset = () => {
                  const { reset, resetInstructions, email: emailText, resetPassword, resetSuccess } = useLocale();
                  const [email, setEmail] = useState('');
                  const [error, setError] = useState('');
                  const [loading, setLoading] = useState(false);
                Severity: Minor
                Found in src/pages/reset.js - About 1 hr to fix

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

                  const populateBasemaps = async (keystone, context) => {
                    // Populate basemaps
                    const {
                      data: { allBasemaps },
                    } = await keystone.executeGraphQL({
                  Severity: Minor
                  Found in initial-data.js - About 1 hr to fix

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

                    const populateLayers = async (keystone, context) => {
                      // Populate layers
                      const {
                        data: { allLayers },
                      } = await keystone.executeGraphQL({
                    Severity: Minor
                    Found in initial-data.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language