koreezgames/phaser3-ninepatch-plugin

View on GitHub

Showing 6 of 10 total issues

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

function create() {
    console.log("create");
    // We specify the x and y position, the width and height and the key for the image of the image.
    // It will be automatically scaled!
    const metalPanel = this.add.ninePatch(200, 200, 300, 300, "metalPanel_blueCorner", null, {
Severity: Major
Found in example/index.ts - About 4 hrs to fix

    Function exports has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = env => {
        if (!env) env = { production: false, karma: false };
    
        let mode = env.production ? "production" : "development";
        let tsconfig = !env.karma ? "tsconfig.json" : "tsconfig.test.json";
    Severity: Major
    Found in webpack.config.js - About 2 hrs to fix

      Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = config => {
          var configuration = {
              basePath: "",
              frameworks: ["mocha", "chai", "sinon", "es6-shim"],
              files: [
      Severity: Minor
      Found in karma.conf.js - About 2 hrs to fix

        Function addAll has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Cache.prototype.addAll = function addAll(requests) {
            var cache = this;
        
            // Since DOMExceptions are not constructable:
            function NetworkError(message) {
        Severity: Minor
        Found in static/scripts/cache-polyfill.js - About 1 hr to fix

          Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = env => {
              if (!env) env = { production: false, karma: false };
          
              let mode = env.production ? "production" : "development";
              let tsconfig = !env.karma ? "tsconfig.json" : "tsconfig.test.json";
          Severity: Minor
          Found in webpack.config.js - About 55 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

          Consider simplifying this complex logical expression.
          Open

            if (
              nativeAddAll && (!userAgent ||
                (agent === 'Firefox' && version >= 46) ||
                (agent === 'Chrome'  && version >= 50)
              )
          Severity: Major
          Found in static/scripts/cache-polyfill.js - About 40 mins to fix
            Severity
            Category
            Status
            Source
            Language