JamieMason/eslint-plugin-prefer-arrow-functions

View on GitHub

Showing 4 of 15 total issues

File prefer-arrow-functions.spec.ts has 801 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { RuleTester } from 'eslint';

import rule from './prefer-arrow-functions';

import {
Severity: Major
Found in src/prefer-arrow-functions.spec.ts - About 1 day to fix

    Function create has 238 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      create: (context) => {
        const options = context.options[0] || {};
        const getOption = (name) =>
          typeof options[name] !== 'undefined'
            ? options[name]
    Severity: Major
    Found in src/prefer-arrow-functions.ts - About 1 day to fix

      Function create has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

        create: (context) => {
          const options = context.options[0] || {};
          const getOption = (name) =>
            typeof options[name] !== 'undefined'
              ? options[name]
      Severity: Minor
      Found in src/prefer-arrow-functions.ts - About 7 hrs 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

      File prefer-arrow-functions.ts has 273 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        DEFAULT_OPTIONS,
        USE_ARROW_WHEN_FUNCTION,
        USE_ARROW_WHEN_SINGLE_RETURN,
        USE_EXPLICIT,
      Severity: Minor
      Found in src/prefer-arrow-functions.ts - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language