File game.boss.js
has 572 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
/* global CivicSeed, ss, Modernizr, $, $game */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_boss
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
var _boss = {
grid: [],
totalScore: null,
modeScore: null,
Function renderTiles
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
renderTiles: function (position) {
var topLeftX = position.x - 1
var topLeftY = position.y - 1
var squares = []
var min = 100
- 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
Function addContent
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
addContent: function (section) {
var overlay = document.getElementById('boss-area')
var speakerEl = overlay.querySelector('.dialog .speaker')
var messageEl = overlay.querySelector('.dialog .message')
var speaker = $game.$botanist.name
Function chooseResumeResponses
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
chooseResumeResponses: function (data) {
var numberToGet = 4
var allResponses = _removeCurrentPlayer(data)
var theChosenOnes = []
- 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
Function renderTiles
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderTiles: function (position) {
var topLeftX = position.x - 1
var topLeftY = position.y - 1
var squares = []
var min = 100
Function chooseResumeResponses
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
chooseResumeResponses: function (data) {
var numberToGet = 4
var allResponses = _removeCurrentPlayer(data)
var theChosenOnes = []
Avoid deeply nested control flow statements. Open
if (_boss.items[itemId].immediate === true) _boss.activateItem(tile)
Function forEachGridTile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
forEachGridTile: function (func) {
var gridX = $game.VIEWPORT_WIDTH
var gridY = $game.VIEWPORT_HEIGHT
for (var x = 0; x < gridX; x++) {
- 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
Function loadVideo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadVideo: function (number) {
var videoEl = document.createElement('video')
var path = CivicSeed.CLOUD_PATH + '/audio/cutscenes/'
if (CivicSeed.ENVIRONMENT === 'development') {
- 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"