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/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

      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;
        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;
            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 join_settings
                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,
                            [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,
                                [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 calculated_difficulty
                          Severity: Major
                          Found in vj4/job/difficulty.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 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,
                                        [id]: data,
                                      };
                                Severity: Major
                                Found in vj4/ui/components/messagepad/reducers/dialogues.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 _parse_dag_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _parse_dag_json(dag):
                                    try:
                                      dag = json.decode(dag)
                                    except decoder.JSONDecodeError:
                                      raise error.ValidationError('dag') from None
                                  Severity: Minor
                                  Found in vj4/handler/training.py - 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 reducer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default function reducer(state = {
                                    rows: [],
                                    items: {},
                                  }, action) {
                                    switch (action.type) {
                                  Severity: Minor
                                  Found in vj4/ui/components/scratchpad/reducers/records.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 _get_exist_node has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _get_exist_node(nodes, node_name):
                                    for category in nodes.values():
                                      assert type(category) is list
                                      for node in category:
                                        if node['name'] == node_name:
                                  Severity: Minor
                                  Found in vj4/model/adaptor/discussion.py - 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