michaelchadwick/ember-remember-stuff

View on GitHub

Showing 10 of 10 total issues

Function transformNode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  transformNode(node) {
    if (node.path.type === 'PathExpression' && node.path.original === 'get-errors-for') {
      if (!node.params[0] || node.params[0].type !== 'PathExpression') {
        throw new Error(
          'the (get-errors-for) helper requires a path to be passed in as its first parameter, received: ' +
Severity: Minor
Found in packages/rs-common/lib/get-errors-for-transform.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 transformNode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  transformNode(node) {
    if (node.path.type === 'PathExpression' && node.path.original === 'has-error-for') {
      if (!node.params[0] || node.params[0].type !== 'PathExpression') {
        throw new Error(
          'the (has-error-for) helper requires a path to be passed in as its first parameter, received: ' +
Severity: Minor
Found in packages/rs-common/lib/has-error-for-transform.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 validatable has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function validatable(target) {
  return class extends target {
    @tracked _evdVisibleErrors = [];
    @tracked _evdShowAllErrors = false;

Severity: Minor
Found in packages/rs-common/addon/decorators/validation/validatable.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 extractQueryParams has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const extractQueryParams = function (request) {
  const params = Object.keys(request.queryParams);
  const rhett = {
    filterParams: [],
    queryTerms: [],
Severity: Minor
Found in packages/rs-common/addon-mirage-support/get-all.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 validateField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  @action
  validateField(fieldName) {
    switch (fieldName) {
      case 'name':
        this.errors.name = this.isNameValid
Severity: Minor
Found in packages/frontend/app/components/forms/contact-form.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 moveFocus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  @action
  moveFocus(event) {
    const { key, target } = event;
    switch (key) {
      case 'ArrowDown':
Severity: Minor
Found in packages/frontend/app/components/locale-chooser.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 spaceship(v.localeCompare(w), 0);
Severity: Major
Found in packages/rs-common/addon/utils/array-helpers.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return spaceship(v.getTime(), w.getTime());
    Severity: Major
    Found in packages/rs-common/addon/utils/array-helpers.js - About 30 mins to fix

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

      export function sortBy(arr, sortKeys) {
        if (arr !== null && typeof arr === 'object') {
          if ('slice' in arr) {
            arr = arr.slice();
          }
      Severity: Minor
      Found in packages/rs-common/addon/utils/array-helpers.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function (environment) {
        const ENV = {
          modulePrefix: 'frontend',
          environment,
          rootURL: '/',
      Severity: Minor
      Found in packages/frontend/config/environment.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