Showing 14 of 21 total issues
Function refresh
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
refresh: function(position,objects){
/* objects should be scene.children */
this.movements.RIGHT=true;
this.movements.LEFT=true;
this.movements.GO=true;
- 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 startLoop
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
startLoop: function(rend, sc, cam, loadBox, data, inp){
var THREE=require("three");
var audio=require("./gajse-audio");
var api=require("./gajse-api");
var storage=require("./gajse-slim-storage");
Function tryToSay
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
tryToSay: function(){
if(this.available && this.stack.length>0)
{
this.available=false;
var current=this.stack.shift();
Function exports
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports=function(grunt){
//browserify -r ./lib/gajse-api -r three > gajse.test.js
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
browserify: {
Function enableAudio
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
enableAudio: function(){
window.AudioContext = window.AudioContext || window.webkitAudioContext;
this.audioContext=new AudioContext();
document.addEventListener("GAJSE_SetBackgroundMusic",function(evt){
console.log("SET BACKGROUND MUSIC: "+evt.detail.resource);
Function refresh
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
refresh: function(position,objects){
/* objects should be scene.children */
this.movements.RIGHT=true;
this.movements.LEFT=true;
this.movements.GO=true;
Function loop
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
loop: function(){
var THREE=require("three");
var collider=require("./gajse-collision");
var delta=this.clock.getDelta();
if(this.loadingBox!="")
Function Item
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.Item=function Item(nam,descriptio,im)
{
var callbacks={
action: function(){},
thinking: function(){},
Function setHUD
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
setHUD: function(resource){
var hud=storage.getURLResourceAs(resource,{type: "image/svg+xml"});
var xhr=new XMLHttpRequest();
xhr.open("GET",hud,true);
xhr.addEventListener("load",function(){
Function playCutscene
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
playCutscene: function(resource,cback,subtitles){
this.callback=cback;
this.video=document.createElement("video");
this.article=document.getElementById("gajse");
this.article.style.position="relative";
Function loop
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
loop: function(){
var THREE=require("three");
var collider=require("./gajse-collision");
var delta=this.clock.getDelta();
if(this.loadingBox!="")
- 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 startLoop
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
startLoop: function(rend, sc, cam, loadBox, data, inp){
Function tryToSay
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
tryToSay: function(){
if(this.available && this.stack.length>0)
{
this.available=false;
var current=this.stack.shift();
- 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 say2
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
say2: function(text, skip, duration, position, color){