Showing 251 of 251 total issues

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

          <Link to="features"
                className="w-col w-col-4 w-clearfix box bg-grey txt-white uppercase">
            <i className="fa fa-fire-extinguisher fa-4x pull-left"/>

            <h3>Features</h3>
Severity: Major
Found in docs/src/components/Hero.js and 2 other locations - About 2 hrs to fix
docs/src/components/Hero.js on lines 60..69
docs/src/components/Hero.js on lines 70..79

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

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

          <Field>
            <Label>
              <span>Font Size:</span>
              <StyledInput
                type="number"
Severity: Major
Found in src/components/layout/content/settings/Editor.js and 2 other locations - About 2 hrs to fix
src/components/layout/content/settings/Editor.js on lines 161..169
src/components/layout/content/settings/Editor.js on lines 209..219

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

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

          <Field>
            <Label>
              <span>Word wrap column size:</span>
              <StyledInput
                type="number"
Severity: Major
Found in src/components/layout/content/settings/Editor.js and 2 other locations - About 2 hrs to fix
src/components/layout/content/settings/Editor.js on lines 152..160
src/components/layout/content/settings/Editor.js on lines 161..169

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

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 Sidebar has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

export const Sidebar = ({
  snippets,
  filterText,
  filterTags,
  filterLanguage,
Severity: Minor
Found in src/components/layout/sidebar/Sidebar.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

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

const LoginWrapper = styled.div`
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
Severity: Major
Found in src/components/LogIn.js and 1 other location - About 2 hrs to fix
src/components/layout/sidebar/Sidebar.js on lines 23..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 84.

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 SearchFilters = styled.div`
  color: ${(props) => props.theme.baseAppColor};
  padding: 10px 20px;
  background: ${(props) => props.theme.lightText};
  z-index: 1;
Severity: Major
Found in src/components/layout/sidebar/Sidebar.js and 1 other location - About 2 hrs to fix
src/components/LogIn.js on lines 25..75

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

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

const createWindow = () => {
  log.transports.file.level = 'debug';
  autoUpdater.logger = log;
  autoUpdater.checkForUpdatesAndNotify();

Severity: Major
Found in src/electron/main.js - About 2 hrs to fix

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

          <UtilityIcon dropdown type="code" color={ theme.baseAppColor }>
            <ScrollPad>
              <div>
                <StyledLanguagesWrapper className="list">
                  <Languagelist/>
    Severity: Major
    Found in src/components/Search.js and 1 other location - About 2 hrs to fix
    src/components/Search.js on lines 109..117

    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

          <UtilityIcon dropdown type="tag" color={ theme.baseAppColor }>
            <ScrollPad>
              <div>
                <StyledTaglistWrapper className="list">
                  <Taglist/>
    Severity: Major
    Found in src/components/Search.js and 1 other location - About 2 hrs to fix
    src/components/Search.js on lines 100..108

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

    import {
      merge,
      keyBy,
      update,
      set,
    Severity: Minor
    Found in src/reducers/snippets.js - About 2 hrs to fix

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

        render() {
          const { data } = this.props;
      
          const menu = (
            <React.Fragment>
      Severity: Major
      Found in docs/src/components/header.js - About 2 hrs to fix

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

          render() {
            const { file, username, snippetId, edit, toggleCollapse, theme } = this.props;
            const openOnWebUrl = `${getSnippetUrl('/gist')}/${username}/${snippetId}#file-${file.filename}`;
        
            return (
        Severity: Minor
        Found in src/components/layout/content/snippet/SnippetHeader.js - About 2 hrs to fix

          Function responseHandler has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const responseHandler = (error, result, dispatch, action) => {
            if (error) {
              if (error.response && error.response.headers['x-github-otp']) {
                setNotification({
                  title: 'Two factor authentication',
          Severity: Minor
          Found in src/middlewares/responseHandler.js - About 2 hrs to fix

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

              test('updateTempSnippet action should be created', () => {
                expect(snippetsActions.updateTempSnippet('snippet.name', 'name here')).toEqual({
                  meta: {
                    path: 'snippet.name',
                    value: 'name here'
            Severity: Major
            Found in __tests__/actions/snippetsActions.spec.js and 2 other locations - About 1 hr to fix
            __tests__/actions/snippetsActions.spec.js on lines 276..288
            __tests__/actions/snippetsActions.spec.js on lines 290..302

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

            test('createSnippetComment action should be created', () => {
              expect(snippetsActions.createSnippetComment('123123', 'hi')).toEqual({
                meta: {
                  id: '123123',
                  body: 'hi'
            Severity: Major
            Found in __tests__/actions/snippetsActions.spec.js and 2 other locations - About 1 hr to fix
            __tests__/actions/snippetsActions.spec.js on lines 192..204
            __tests__/actions/snippetsActions.spec.js on lines 290..302

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

            test('deleteComment action should be created', () => {
              expect(snippetsActions.deleteComment('123123', '234234')).toEqual({
                meta: {
                  id: '123123',
                  commentId: '234234'
            Severity: Major
            Found in __tests__/actions/snippetsActions.spec.js and 2 other locations - About 1 hr to fix
            __tests__/actions/snippetsActions.spec.js on lines 192..204
            __tests__/actions/snippetsActions.spec.js on lines 276..288

            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

            Function snippets has a Cognitive Complexity of 15 (exceeds 5 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: Minor
            Found in src/reducers/snippets.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

              const linearGradient = (percentOf) => {
                const percents = (percentOf / size(snippets)) * 100;
            
                return {
                  background: `linear-gradient(to right, ${theme.headerBgLightest} ${Math.floor(
            Severity: Major
            Found in src/components/common/Languagelist.js and 1 other location - About 1 hr to fix
            src/components/common/Taglist.js on lines 14..22

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

            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 linearGradient = (percentOf) => {
                const percents = (percentOf / size(taggedSnippets)) * 100;
            
                return {
                  background: `linear-gradient(to right, ${theme.headerBgLightest} ${Math.floor(
            Severity: Major
            Found in src/components/common/Taglist.js and 1 other location - About 1 hr to fix
            src/components/common/Languagelist.js on lines 12..20

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

            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

                case AT.FILTER_SNIPPETS_BY_UNTAGGED: {
                  return flow([
                    set(['filter', 'text'], ''),
                    set(['filter', 'tags'], []),
                    set(['filter', 'language'], ''),
            Severity: Major
            Found in src/reducers/snippets.js and 2 other locations - About 1 hr to fix
            src/reducers/snippets.js on lines 123..132
            src/reducers/snippets.js on lines 145..154

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

            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