dopry/netlify-cms

View on GitHub

Showing 220 of 220 total issues

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

export function entryDeleting(collection, slug) {
  return {
    type: ENTRY_DELETE_REQUEST,
    payload: {
      collectionName: collection.get('name'),
Severity: Minor
Found in src/actions/entries.js and 2 other locations - About 35 mins to fix
src/actions/entries.js on lines 52..60
src/actions/entries.js on lines 144..152

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

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

Avoid too many return statements within this function.
Open

    return { widget: 'text' };
Severity: Major
Found in scripts/autoconfigure.collection.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return { widget: 'number' };
    Severity: Major
    Found in scripts/autoconfigure.collection.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return { widget: 'image' };
      Severity: Major
      Found in scripts/autoconfigure.collection.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return u(typeMap[node.type]);
        Severity: Major
        Found in src/components/Widgets/Markdown/serializers/slateRemark.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return [a, b].sort((fieldA, fieldB) => compareWidget(fieldB.widget, fieldA.widget))[0];
          Severity: Major
          Found in scripts/autoconfigure.collection.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return state.transform().toggleMark(mark).apply();
            Severity: Major
            Found in src/components/Widgets/Markdown/MarkdownControl/VisualEditor/keys.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return a;
              Severity: Major
              Found in scripts/autoconfigure.collection.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return (
                      <Sidebar content={sidebarContent}>
                        <Layout>
                          <Notifs CustomComponent={Toast} />
                          <AppHeader
                Severity: Major
                Found in src/containers/App.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return createBlock(slateType, nodes);
                  Severity: Major
                  Found in src/components/Widgets/Markdown/serializers/remarkSlate.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return createText('\n');
                    Severity: Major
                    Found in src/components/Widgets/Markdown/serializers/remarkSlate.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return null;
                      Severity: Major
                      Found in src/reducers/collections.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return unwrapped.insertBlock(defaultBlock).apply();
                        Severity: Major
                        Found in src/components/Widgets/Markdown/MarkdownControl/VisualEditor/plugins.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return state.transform().insertText('\n').apply();
                          Severity: Major
                          Found in src/components/Widgets/Markdown/MarkdownControl/VisualEditor/plugins.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return { widget: 'markdown' };
                            Severity: Major
                            Found in scripts/autoconfigure.collection.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                return { widget: 'string' };
                              Severity: Major
                              Found in scripts/autoconfigure.collection.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return 0;
                                Severity: Major
                                Found in src/formats/yaml.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return u(typeMap[node.type], props, children);
                                  Severity: Major
                                  Found in src/components/Widgets/Markdown/serializers/slateRemark.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return acc;
                                    Severity: Major
                                    Found in src/lib/serializeEntryValues.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                          return { widget: 'object', fields: inferFields([value]) };
                                      Severity: Major
                                      Found in scripts/autoconfigure.collection.js - About 30 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language