Showing 251 of 251 total issues

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

        <Section>
          <Field>
            <Label>
              <span>Preview HTML files:</span>
              <Checkbox
Severity: Major
Found in src/components/layout/content/settings/Editor.js and 1 other location - About 1 day to fix
src/components/layout/content/settings/Editor.js on lines 263..299

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

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

        <Section>
          <Field>
            <Label>
              <span>Preview GeoJSON:</span>
              <Checkbox
Severity: Major
Found in src/components/layout/content/settings/Editor.js and 1 other location - About 1 day to fix
src/components/layout/content/settings/Editor.js on lines 225..261

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

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

export const snippets = (state = initialState, action) => {
  switch (action.type) {
    case AT.GET_SNIPPETS.SUCCESS: {
      const lastUpdated = state.lastUpdated === null ? toISOString() : state.lastUpdated;

Severity: Major
Found in src/reducers/snippets.js - About 1 day to fix

    File SnippetHeader.js has 516 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import PropTypes from 'prop-types';
    import { connect } from 'react-redux';
    import { drop, get, isEmpty, map, size, toString, isArray } from 'lodash/fp';
    import styled from 'styled-components';
    Severity: Major
    Found in src/components/layout/headers/SnippetHeader.js - About 1 day to fix

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

        test('should filter snippets by truncated', () => {
          const action = {
            type: AT.FILTER_SNIPPETS_BY_TRUNCATED,
            payload: {
              status: 'truncated'
      Severity: Major
      Found in __tests__/reduceres/snippets.spec.js and 2 other locations - About 5 hrs to fix
      __tests__/reduceres/snippets.spec.js on lines 206..238
      __tests__/reduceres/snippets.spec.js on lines 274..306

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

      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

        test('should filter snippets by status', () => {
          const action = {
            type: AT.FILTER_SNIPPETS_BY_STATUS,
            payload: {
              status: 'private'
      Severity: Major
      Found in __tests__/reduceres/snippets.spec.js and 2 other locations - About 5 hrs to fix
      __tests__/reduceres/snippets.spec.js on lines 240..272
      __tests__/reduceres/snippets.spec.js on lines 274..306

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

      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

        test('should filter snippets by untagged', () => {
          const action = {
            type: AT.FILTER_SNIPPETS_BY_UNTAGGED,
            payload: {
              status: 'untagged'
      Severity: Major
      Found in __tests__/reduceres/snippets.spec.js and 2 other locations - About 5 hrs to fix
      __tests__/reduceres/snippets.spec.js on lines 206..238
      __tests__/reduceres/snippets.spec.js on lines 240..272

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

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

        render() {
          const snippetUrl = getSnippetUrl('/gist');
          const { snippets, match, editSnippet, comments } = this.props;
          const snippet = get(match.params.id, snippets);
          const snippetId = get('id', snippet);
      Severity: Major
      Found in src/components/layout/headers/SnippetHeader.js - About 5 hrs to fix

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

          render() {
            return (
              <section className="whiter boxes inner">
                <div className="w-container">
                  <p className="txt-grey txt-center">
        Severity: Major
        Found in docs/src/components/Downloads.js - About 5 hrs to fix

          File NewSnippet.js has 397 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import PropTypes from 'prop-types';
          import { connect } from 'react-redux';
          import styled from 'styled-components';
          import {
          Severity: Minor
          Found in src/components/layout/content/NewSnippet.js - About 5 hrs to fix

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

                if (action.type === AT.GET_USER) {
                  dispatch({ type: AT.GET_USER.PENDING, action });
                  API.get(`${getApiUrl('/api/v3')}/user`)
                    .set(_headers())
                    .end((error, result) => {
            Severity: Major
            Found in src/middlewares/gitHubAPI.js and 2 other locations - About 5 hrs to fix
            src/middlewares/gitHubAPI.js on lines 31..42
            src/middlewares/gitHubAPI.js on lines 123..134

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

            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

                if (action.type === AT.GET_RATE_LIMIT) {
                  dispatch({ type: AT.GET_RATE_LIMIT.PENDING, action });
                  API.get(`${getApiUrl('/api/v3')}/rate_limit`)
                    .set(_headers())
                    .end((error, result) => {
            Severity: Major
            Found in src/middlewares/gitHubAPI.js and 2 other locations - About 5 hrs to fix
            src/middlewares/gitHubAPI.js on lines 110..121
            src/middlewares/gitHubAPI.js on lines 123..134

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

            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

                if (action.type === AT.GET_EMOJI) {
                  dispatch({ type: AT.GET_EMOJI.PENDING, action });
                  API.get(`${getApiUrl('/api/v3')}/emojis`)
                    .set(_headers())
                    .end((error, result) => {
            Severity: Major
            Found in src/middlewares/gitHubAPI.js and 2 other locations - About 5 hrs to fix
            src/middlewares/gitHubAPI.js on lines 31..42
            src/middlewares/gitHubAPI.js on lines 110..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 146.

            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 DashBoard.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import PropTypes from 'prop-types';
            import { connect } from 'react-redux';
            import styled, { css } from 'styled-components';
            import { size, filter, map, flow, isEmpty, get } from 'lodash/fp';
            Severity: Minor
            Found in src/components/layout/content/DashBoard.js - About 5 hrs to fix

              File snippets.spec.js has 368 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import * as AT from 'constants/actionTypes';
              import { snippets as reducer } from 'reducers/snippets';
              
              import { rawSnippets, snippet, snippets } from '../../__mocks__/snippets';
              import { filter, head, keyBy, map, merge } from 'lodash/fp';
              Severity: Minor
              Found in __tests__/reduceres/snippets.spec.js - About 4 hrs to fix

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

                  render() {
                    const { theme, tags } = this.props;
                    const languageFromSettings = getSetting('setings-default-new-snippet-language', 'Text');
                
                    return (
                Severity: Major
                Found in src/components/layout/content/NewSnippet.js - About 4 hrs to fix

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

                  describe('COMPONENTS - <Checkbox>', () => {
                    test('render Checkbox', () => {
                      const component = setup();
                  
                      expect(component).toMatchSnapshot();
                  Severity: Major
                  Found in __tests__/components/common/controls/Checkbox.spec.js and 2 other locations - About 4 hrs to fix
                  __tests__/components/common/controls/Input.spec.js on lines 13..31
                  __tests__/components/common/controls/TextArea.spec.js on lines 13..31

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

                  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

                  describe('COMPONENTS - <TextArea>', () => {
                    test('render TextArea', () => {
                      const component = setup();
                  
                      expect(component).toMatchSnapshot();
                  Severity: Major
                  Found in __tests__/components/common/controls/TextArea.spec.js and 2 other locations - About 4 hrs to fix
                  __tests__/components/common/controls/Checkbox.spec.js on lines 12..30
                  __tests__/components/common/controls/Input.spec.js on lines 13..31

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

                  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

                  describe('COMPONENTS - <Input>', () => {
                    test('render Input', () => {
                      const component = setup();
                  
                      expect(component).toMatchSnapshot();
                  Severity: Major
                  Found in __tests__/components/common/controls/Input.spec.js and 2 other locations - About 4 hrs to fix
                  __tests__/components/common/controls/Checkbox.spec.js on lines 12..30
                  __tests__/components/common/controls/TextArea.spec.js on lines 13..31

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

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

                    render() {
                      if (isElectron) {
                        const { ipcRenderer } = require('electron');
                  
                        ipcRenderer.on('token', (event, token) => {
                  Severity: Major
                  Found in src/components/LogIn.js - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language