Showing 6 of 10 total issues
Function create
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
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, {
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
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";
Function exports
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = config => {
var configuration = {
basePath: "",
frameworks: ["mocha", "chai", "sinon", "es6-shim"],
files: [
Function addAll
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Cache.prototype.addAll = function addAll(requests) {
var cache = this;
// Since DOMExceptions are not constructable:
function NetworkError(message) {
Function exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
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";
- Read upRead up
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
Open
if (
nativeAddAll && (!userAgent ||
(agent === 'Firefox' && version >= 46) ||
(agent === 'Chrome' && version >= 50)
)