casefoundation/weekly-roundup

View on GitHub

Showing 49 of 49 total issues

Function Update has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

  Update: function (id, title, source, published, summary, url, article_group_id, group_order_shift) {
Severity: Major
Found in server/lib/models/Article.js - About 1 hr to fix

    Function articleUpdate has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function articleUpdate(id, title, url, published, source, summary, group_order_shift) {
    Severity: Major
    Found in client/src/actions/Article/ArticleActions.js - About 50 mins to fix

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

        Update: function (user_id, roundup_id, subject, to, cc, preface) {
      Severity: Minor
      Found in server/lib/models/Roundup.js - About 45 mins to fix

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

          render() {
            let content;
            let buttons;
            let modal;
            if (this.props.Roundup.roundup && this.props.Roundup.roundup.result) {
        Severity: Minor
        Found in client/src/containers/Roundups/View.js - About 45 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 roundupUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function roundupUpdate(id, subject, to, cc, preface) {
        Severity: Minor
        Found in client/src/actions/Roundup/RoundupActions.js - About 35 mins to fix

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

          export function settingsUpdate(signature, old_password, new_password) {
            let validationError;
            if (!validateString(signature, 0, 512, true)) {
              validationError = `Invalid Signature. Must be 0-512 characters: ${signature}`;
            }
          Severity: Minor
          Found in client/src/actions/Settings/SettingsActions.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 saveUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          const saveUser = (req, res) => {
            const saveUserHelper = (user) => {
              if (req.body.password && req.body.password.trim().length > 0) {
                user.setPassword(req.body.password);
              }
          Severity: Minor
          Found in server/lib/routes/user.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 updateArticleGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          export function updateArticleGroup(roundup, articleGroup) {
            let updatedRoundup = roundup;
          
            // Update Entity
            // Update Target ArticleGroup
          Severity: Minor
          Found in client/src/schemas/ArticleGroupSchema.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 completeReset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          const completeReset = (req, res) => {
            if (req.params.code) {
              User.byCode(req.params.code)
                .then((user) => {
                  if (user) {
          Severity: Minor
          Found in server/lib/routes/user.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