JamieMason/eslint-plugin-move-files

View on GitHub

Showing 26 of 26 total issues

Avoid too many return statements within this function.
Open

  return '';
Severity: Major
Found in src/lib/path-reader.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return getIn(query.length - 2, getAncestors(absPath), '');
    Severity: Major
    Found in src/lib/path-reader.ts - About 30 mins to fix

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

        create: (context) => {
          const currentFilePath = context.getFilename();
          const dirPath = dirname(currentFilePath);
      
          if (visitedFiles[currentFilePath]) {
      Severity: Minor
      Found in src/move-files.ts - 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

      Array type using 'Array<t>' is forbidden. Use 'T[]' instead.</t>
      Open

        consumers: Array<[ConsumerPath, OldModuleId, NewModuleId?]>;
      Severity: Minor
      Found in src/move-files.spec.ts by tslint

      Rule: array-type

      Requires using either 'T[]' or 'Array<t>' for arrays.</t>

      Notes
      • TypeScript Only
      • Has Fix

      Config

      One of the following arguments must be provided:

      • "array" enforces use of T[] for all types T.
      • "generic" enforces use of Array<T> for all types T.
      • "array-simple" enforces use of T[] if T is a simple type (primitive or type reference).
      Examples
      "array-type": true,array
      "array-type": true,generic
      "array-type": true,array-simple
      Schema
      {
        "type": "string",
        "enum": [
          "array",
          "generic",
          "array-simple"
        ]
      }

      For more information see this page.

      Array type using 'Array<t>' is forbidden. Use 'T[]' instead.</t>
      Open

              const contentsChecks: Array<() => void> = [];
      Severity: Minor
      Found in src/move-files.spec.ts by tslint

      Rule: array-type

      Requires using either 'T[]' or 'Array<t>' for arrays.</t>

      Notes
      • TypeScript Only
      • Has Fix

      Config

      One of the following arguments must be provided:

      • "array" enforces use of T[] for all types T.
      • "generic" enforces use of Array<T> for all types T.
      • "array-simple" enforces use of T[] if T is a simple type (primitive or type reference).
      Examples
      "array-type": true,array
      "array-type": true,generic
      "array-type": true,array-simple
      Schema
      {
        "type": "string",
        "enum": [
          "array",
          "generic",
          "array-simple"
        ]
      }

      For more information see this page.

      Array type using 'Array<t>' is forbidden. Use 'T[]' instead.</t>
      Open

        imports: Array<[OldModuleId, NewModuleId?]>;
      Severity: Minor
      Found in src/move-files.spec.ts by tslint

      Rule: array-type

      Requires using either 'T[]' or 'Array<t>' for arrays.</t>

      Notes
      • TypeScript Only
      • Has Fix

      Config

      One of the following arguments must be provided:

      • "array" enforces use of T[] for all types T.
      • "generic" enforces use of Array<T> for all types T.
      • "array-simple" enforces use of T[] if T is a simple type (primitive or type reference).
      Examples
      "array-type": true,array
      "array-type": true,generic
      "array-type": true,array-simple
      Schema
      {
        "type": "string",
        "enum": [
          "array",
          "generic",
          "array-simple"
        ]
      }

      For more information see this page.

      Severity
      Category
      Status
      Source
      Language