nielse63/launch-checklist

View on GitHub

Showing 27 of 27 total issues

Function wordWrap has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const wordWrap = function (string, max = 80) {
  function getWords(str) {
    return str
      .toString()
      .split(/(\S+\s+)/)
Severity: Major
Found in lib/utils.js - About 2 hrs to fix

Function default has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (headers) {
  function shouldHave(_keys) {
    let passed = true
    const mustHave = ['x-xss-protection', 'x-frame-options']
    mustHave.forEach(key => {
Severity: Minor
Found in lib/tests/security.js - About 2 hrs to fix

Function default has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (url) {
  return new Promise((resolve, reject) => {
    const get = getInsightsURL(url)

    https.get(get, res => {
Severity: Minor
Found in lib/tests/performance.js - About 1 hr to fix

Function default has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (data) {
  const $ = cheerio.load(data.body)

  return [
    {
Severity: Minor
Found in lib/tests/index.js - About 1 hr to fix

Function default has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function (url) {
  return new Promise((resolve, reject) => {
    const get = getInsightsURL(url, 'mobile')

    https.get(get, res => {
Severity: Minor
Found in lib/tests/mobile.js - About 1 hr to fix

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

  tests.forEach(results => {
    if (results.passed) {
      return
    }
    output.passed = false
Severity: Major
Found in lib/tests/favicons.js and 2 other locations - About 1 hr to fix
lib/tests/security.js on lines 48..54
lib/tests/seo.js on lines 27..33

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

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

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

  tests.forEach(object => {
    if (object.passed) {
      return
    }
    output.passed = false
Severity: Major
Found in lib/tests/security.js and 2 other locations - About 1 hr to fix
lib/tests/favicons.js on lines 26..32
lib/tests/seo.js on lines 27..33

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

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

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

  tests.forEach(results => {
    if (results.passed) {
      return
    }
    output.passed = false
Severity: Major
Found in lib/tests/seo.js and 2 other locations - About 1 hr to fix
lib/tests/favicons.js on lines 26..32
lib/tests/security.js on lines 48..54

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

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

Function default has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ($) {
  if (!$) {
    throw new Error('No cheerio object provided')
  }
  const $head = $('head')
Severity: Minor
Found in lib/tests/favicons.js - About 1 hr to fix

Function default has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function ($) {
  const $head = $('head')
  const elements = {
    title: $head.find('title'),
    description: $head.find('meta[name="description"]'),
Severity: Minor
Found in lib/tests/seo.js - About 1 hr to fix

Function wordWrap has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const wordWrap = function (string, max = 80) {
  function getWords(str) {
    return str
      .toString()
      .split(/(\S+\s+)/)
Severity: Minor
Found in lib/utils.js - About 1 hr 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 getLines has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function getLines(words) {
    return words.reduce((lines, word) => {
      if (word === '') {
        return lines
      }
Severity: Minor
Found in lib/utils.js - About 1 hr to fix

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

  output.reason = `${output.info.length} SEO ${output.info.length > 1 ? 'issues' : 'issue'} found`
Severity: Major
Found in lib/tests/seo.js and 2 other locations - About 45 mins to fix
lib/tests/favicons.js on lines 33..33
lib/tests/security.js on lines 55..55

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

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

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

  output.reason = `${output.info.length} security ${output.info.length > 1 ? 'issues' : 'issue'} found`
Severity: Major
Found in lib/tests/security.js and 2 other locations - About 45 mins to fix
lib/tests/favicons.js on lines 33..33
lib/tests/seo.js on lines 35..35

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

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

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

  output.reason = `${output.info.length} ${output.info.length > 1 ? 'icons' : 'icon'} not found`
Severity: Major
Found in lib/tests/favicons.js and 2 other locations - About 45 mins to fix
lib/tests/security.js on lines 55..55
lib/tests/seo.js on lines 35..35

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

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

Assignment to property of function parameter 'lines'.
Open

        lines[i] += xs.shift()
Severity: Minor
Found in lib/utils.js by eslint

Disallow Reassignment of Function Parameters (no-param-reassign)

Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the arguments object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.

This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.

Rule Details

This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.

Examples of incorrect code for this rule:

/*eslint no-param-reassign: "error"*/

function foo(bar) {
    bar = 13;
}

function foo(bar) {
    bar++;
}

Examples of correct code for this rule:

/*eslint no-param-reassign: "error"*/

function foo(bar) {
    var baz = bar;
}

Options

This rule takes one option, an object, with a boolean property "props" and an array "ignorePropertyModificationsFor". "props" is false by default. If "props" is set to true, this rule warns against the modification of parameter properties unless they're included in "ignorePropertyModificationsFor", which is an empty array by default.

props

Examples of correct code for the default { "props": false } option:

/*eslint no-param-reassign: ["error", { "props": false }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

Examples of incorrect code for the { "props": true } option:

/*eslint no-param-reassign: ["error", { "props": true }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

Examples of correct code for the { "props": true } option with "ignorePropertyModificationsFor" set:

/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

When Not To Use It

If you want to allow assignment to function parameters, then you can safely disable this rule.

Further Reading

Assignment to property of function parameter 'lines'.
Open

        lines[i] += chunk
Severity: Minor
Found in lib/utils.js by eslint

Disallow Reassignment of Function Parameters (no-param-reassign)

Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the arguments object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.

This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.

Rule Details

This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.

Examples of incorrect code for this rule:

/*eslint no-param-reassign: "error"*/

function foo(bar) {
    bar = 13;
}

function foo(bar) {
    bar++;
}

Examples of correct code for this rule:

/*eslint no-param-reassign: "error"*/

function foo(bar) {
    var baz = bar;
}

Options

This rule takes one option, an object, with a boolean property "props" and an array "ignorePropertyModificationsFor". "props" is false by default. If "props" is set to true, this rule warns against the modification of parameter properties unless they're included in "ignorePropertyModificationsFor", which is an empty array by default.

props

Examples of correct code for the default { "props": false } option:

/*eslint no-param-reassign: ["error", { "props": false }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

Examples of incorrect code for the { "props": true } option:

/*eslint no-param-reassign: ["error", { "props": true }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

Examples of correct code for the { "props": true } option with "ignorePropertyModificationsFor" set:

/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

When Not To Use It

If you want to allow assignment to function parameters, then you can safely disable this rule.

Further Reading

Assignment to property of function parameter 'lines'.
Open

        lines[i] = lines[i].replace(/\s+$/, '')
Severity: Minor
Found in lib/utils.js by eslint

Disallow Reassignment of Function Parameters (no-param-reassign)

Assignment to variables declared as function parameters can be misleading and lead to confusing behavior, as modifying function parameters will also mutate the arguments object. Often, assignment to function parameters is unintended and indicative of a mistake or programmer error.

This rule can be also configured to fail when function parameters are modified. Side effects on parameters can cause counter-intuitive execution flow and make errors difficult to track down.

Rule Details

This rule aims to prevent unintended behavior caused by modification or reassignment of function parameters.

Examples of incorrect code for this rule:

/*eslint no-param-reassign: "error"*/

function foo(bar) {
    bar = 13;
}

function foo(bar) {
    bar++;
}

Examples of correct code for this rule:

/*eslint no-param-reassign: "error"*/

function foo(bar) {
    var baz = bar;
}

Options

This rule takes one option, an object, with a boolean property "props" and an array "ignorePropertyModificationsFor". "props" is false by default. If "props" is set to true, this rule warns against the modification of parameter properties unless they're included in "ignorePropertyModificationsFor", which is an empty array by default.

props

Examples of correct code for the default { "props": false } option:

/*eslint no-param-reassign: ["error", { "props": false }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

Examples of incorrect code for the { "props": true } option:

/*eslint no-param-reassign: ["error", { "props": true }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

Examples of correct code for the { "props": true } option with "ignorePropertyModificationsFor" set:

/*eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["bar"] }]*/

function foo(bar) {
    bar.prop = "value";
}

function foo(bar) {
    delete bar.aaa;
}

function foo(bar) {
    bar.aaa++;
}

When Not To Use It

If you want to allow assignment to function parameters, then you can safely disable this rule.

Further Reading

Unordered list style
Open

  - If the page/url being checked hasn't changed since the last time it was validated, return the same results as previously
Severity: Info
Found in TODO.md by markdownlint

MD004 - Unordered list style

Tags: bullet, ul

Aliases: ul-style

Parameters: style ("consistent", "asterisk", "plus", "dash"; default "consistent")

This rule is triggered when the symbols used in the document for unordered list items do not match the configured unordered list style:

* Item 1
+ Item 2
- Item 3

To fix this issue, use the configured style for list items throughout the document:

* Item 1
* Item 2
* Item 3

Note: the configured list style can be a specific symbol to use (asterisk, plus, dash), or simply require that the usage be consistent within the document.

Unordered list style
Open

  - Value for the key should be an encoded value determining if the page has changed
Severity: Info
Found in TODO.md by markdownlint

MD004 - Unordered list style

Tags: bullet, ul

Aliases: ul-style

Parameters: style ("consistent", "asterisk", "plus", "dash"; default "consistent")

This rule is triggered when the symbols used in the document for unordered list items do not match the configured unordered list style:

* Item 1
+ Item 2
- Item 3

To fix this issue, use the configured style for list items throughout the document:

* Item 1
* Item 2
* Item 3

Note: the configured list style can be a specific symbol to use (asterisk, plus, dash), or simply require that the usage be consistent within the document.

Severity
Category
Status
Source
Language