Showing 126 of 199 total issues

Avoid too many return statements within this function.
Open

    return state;
Severity: Major
Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return {
          ..._.omit(state, placeholderId),
          [action.payload.mdoc._id]: '',
        };
    Severity: Major
    Found in vj4/ui/components/messagepad/reducers/inputs.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return;
      Severity: Major
      Found in scripts/build/utils/transformConstant.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return None
        Severity: Major
        Found in vj4/model/domain.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return {
                ...state,
                isPosting: false,
              };
          Severity: Major
          Found in vj4/ui/components/scratchpad/reducers/ui.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return state;
            Severity: Major
            Found in vj4/ui/components/messagepad/reducers/dialogues.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return {
                    ...state,
                    [placeholderId]: false,
                  };
              Severity: Major
              Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return {
                      ...state,
                      isPosting: false,
                    };
                Severity: Major
                Found in vj4/ui/components/scratchpad/reducers/ui.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return next(iter(setting.range))
                  Severity: Major
                  Found in vj4/model/adaptor/setting.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return {
                          ...state,
                          [placeholderId]: true,
                        };
                    Severity: Major
                    Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return {
                            ...state,
                            records: {
                              ...state.records,
                              isLoading: false,
                      Severity: Major
                      Found in vj4/ui/components/scratchpad/reducers/ui.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return {
                                ...state,
                                [id]: false,
                              };
                        Severity: Major
                        Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return state;
                          Severity: Major
                          Found in vj4/ui/components/messagepad/reducers/inputs.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return setting.factory()
                            Severity: Major
                            Found in vj4/model/adaptor/setting.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return {
                                      ...state,
                                      [id]: {
                                        ...state[id],
                                        reply: [
                              Severity: Major
                              Found in vj4/ui/components/messagepad/reducers/dialogues.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return {
                                      ..._.omit(state, placeholderId),
                                      [action.payload.mdoc._id]: false,
                                    };
                                Severity: Major
                                Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

                                  Function request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  pjax.request = async opt => {
                                    const options = {
                                      method: 'get',
                                      push: true,
                                      ...opt,
                                  Severity: Minor
                                  Found in vj4/ui/utils/pjax.js - About 25 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 detachAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    static detachAll(container = document.body) {
                                      const selector = this.DOMDetachSelector || this.DOMAttachSelector;
                                      if (process.env.NODE_ENV !== 'production') {
                                        if (!selector) {
                                          // eslint-disable-next-line quotes
                                  Severity: Minor
                                  Found in vj4/ui/components/DOMAttachedObject.js - About 25 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 mapDispatchToProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const mapDispatchToProps = dispatch => ({
                                    handleChange(id, value) {
                                      if (id === null) {
                                        return;
                                      }
                                  Severity: Minor
                                  Found in vj4/ui/components/messagepad/MessagePadInputContainer.js - About 25 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 scrollToViewport has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function scrollToViewport() {
                                    const BOUND_TOP = 60;
                                    const BOUND_BOTTOM = 20;
                                    const node = $('.messagepad')[0];
                                    if (node.offsetHeight + BOUND_TOP + BOUND_BOTTOM < window.innerHeight) {
                                  Severity: Minor
                                  Found in vj4/ui/components/messagepad/reducers/activeId.js - About 25 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language