dopry/netlify-cms

View on GitHub

Showing 110 of 220 total issues

Function localQuery has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function localQuery(namespace, collection, searchFields, searchTerm, state, dispatch) {
Severity: Minor
Found in src/actions/search.js - About 45 mins to fix

    Function queryFailure has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function queryFailure(namespace, collection, searchFields, searchTerm, error) {
    Severity: Minor
    Found in src/actions/search.js - About 35 mins to fix

      Function querySuccess has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function querySuccess(namespace, collection, searchFields, searchTerm, response) {
      Severity: Minor
      Found in src/actions/search.js - About 35 mins to fix

        Function unpublishedEntryStatusChangePersisted has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function unpublishedEntryStatusChangePersisted(collection, slug, oldStatus, newStatus, transactionID) {
        Severity: Minor
        Found in src/actions/editorialWorkflow.js - About 35 mins to fix

          Function unpublishedEntryStatusChangeRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function unpublishedEntryStatusChangeRequest(collection, slug, oldStatus, newStatus, transactionID) {
          Severity: Minor
          Found in src/actions/editorialWorkflow.js - About 35 mins to fix

            Function combineFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function combineFields(a, b) {
              if (b == null && a) {
                return a;
              }
              if (a == null && b) {
            Severity: Minor
            Found in scripts/autoconfigure.collection.js - About 35 mins 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

            Function localQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function localQuery(namespace, collection, searchFields, searchTerm, state, dispatch) {
              // Check if entries in this collection were already loaded
              if (state.entries.hasIn(['pages', collection, 'ids'])) {
                const entries = selectEntries(state, collection).toJS();
                const filteredEntries = fuzzy.filter(searchTerm, entries, {
            Severity: Minor
            Found in src/actions/search.js - About 35 mins 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

            Function remarkShortcodes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function remarkShortcodes({ plugins }) {
              return transform;
            
              /**
               * Map over children of the root node and convert any found shortcode nodes.
            Severity: Minor
            Found in src/components/Widgets/Markdown/serializers/remarkShortcodes.js - About 35 mins 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

            Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              render() {
                const {
                  user,
                  config,
                  children,
            Severity: Minor
            Found in src/containers/App.js - About 35 mins 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

            Function EntryPageHOC has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function EntryPageHOC(EntryPage) {
              class EntryPageHOC extends React.Component {
                render() {
                  return <EntryPage {...this.props} />;
                }
            Severity: Minor
            Found in src/containers/editorialWorkflow/EntryPageHOC.js - About 35 mins 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

            Function getEndpoint has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function getEndpoint(endpoint, netlifySiteURL) {
              if (localHosts[document.location.host.split(":").shift()] && netlifySiteURL && endpoint.match(/^\/\.netlify\//)) {
                const parts = [];
                if (netlifySiteURL) {
                  parts.push(netlifySiteURL);
            Severity: Minor
            Found in src/backends/git-gateway/implementation.js - About 35 mins 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

            Function authenticate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              authenticate(options, cb) {
                var left, top, url,
                  siteID = this.getSiteID(),
                  provider = options.provider;
                if (!provider) {
            Severity: Minor
            Found in src/lib/netlify-auth.js - About 35 mins 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

            Function selectInferedField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export const selectInferedField = (collection, fieldName) => {
              const inferableField = INFERABLE_FIELDS[fieldName];
              const fields = collection.get('fields');
              let field;
            
            
            Severity: Minor
            Found in src/reducers/collections.js - About 35 mins 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

            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
                          Severity
                          Category
                          Status
                          Source
                          Language