khalyomede/gridsome-plugin-manifest

View on GitHub

Showing 5 of 16 total issues

File gridsome.server.ts has 353 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { existsSync, writeFileSync } from "fs";
import * as isHexcolor from "is-hexcolor";
import * as mime from "mime-types";
import { sync } from "mkdirp";
import { basename, isAbsolute } from "path";
Severity: Minor
Found in src/gridsome.server.ts - About 4 hrs to fix

    Function constructor has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public constructor(api: IPluginAPI, options: IOptions) {
            this._options = options;
    
            api.beforeBuild(async () => {
                /* tslint:disable:no-console */
    Severity: Major
    Found in src/gridsome.server.ts - About 4 hrs to fix

      Function _checkRelatedApplicationsOption has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          private _checkRelatedApplicationsOption(): void {
              const optionName = "related_applications";
      
              this._throwIfOptionMissing(optionName);
      
      
      Severity: Minor
      Found in src/gridsome.server.ts - About 2 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

      Function _checkRelatedApplicationsOption has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private _checkRelatedApplicationsOption(): void {
              const optionName = "related_applications";
      
              this._throwIfOptionMissing(optionName);
      
      
      Severity: Major
      Found in src/gridsome.server.ts - About 2 hrs to fix

        GridsomePluginManifest has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class GridsomePluginManifest {
            static readonly pluginName = "gridsome-plugin-manifest";
        
            private readonly _options: IOptions;
        
        
        Severity: Minor
        Found in src/gridsome.server.ts - About 2 hrs to fix
          Severity
          Category
          Status
          Source
          Language