kubosho/kotori

View on GitHub

Showing 6 of 51 total issues

Function transformCore has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  transformCore(config, file, callback) {
    if (file.isNull()) {
      callback(null, file);
      return;
    }
Severity: Minor
Found in src/build.js - About 1 hr to fix

    Function writeStats has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      writeStats(statsData) {
        const statsFileName = path.basename(this.statsTargetFilePath, path.extname(this.statsTargetFilePath));
        const statsOutputDir = `${process.cwd()}/${this.statsConf.outputDir}`;
        const format = new Format(statsData);
        const formatData = selectFormat(this.statsConf.outputFormat);
    Severity: Minor
    Found in src/stats.js - About 1 hr to fix

      Function default has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function(args) {
        let currentOptions;
      
        try {
          currentOptions = options.parse(args);
      Severity: Minor
      Found in src/cli/cli.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 activatePostCSSPlugins has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function activatePostCSSPlugins(config) {
        const plugins = [];
      
        if (config.lintRules || config.lintRules !== "") {
          // TODO: Throw easy-to-understand error message
      Severity: Minor
      Found in src/build.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 parseConfigCore has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      function parseConfigCore(configItem) {
        if (isObject(configItem) || isJSON(configItem)) {
          try {
            configItem = JSON.parse(configItem);
          } catch (err) {
      Severity: Minor
      Found in src/config.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 load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        load() {
          let configLoadErrors = [];
      
          try {
            this.config = loadConfigCore(this.filePath);
      Severity: Minor
      Found in src/config.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