uccser/cs-field-guide

View on GitHub

Showing 427 of 873 total issues

File Treant.js has 1396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Treant-js
 *
 * Modified by UCCSER:
 * Adds fix for showing arrows on connectors after a pseudo connector.
Severity: Major
Found in csfieldguide/static/interactives/tree-diagram/js/third-party/Treant.js - About 3 days to fix

File pixel-viewer.js has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Settings and intialize layout
this.MAX_HEIGHT = 133;
this.CELL_SIZE = 50;
this.MAX_NOISE = 15;

Severity: Major
Found in csfieldguide/static/interactives/pixel-viewer/js/pixel-viewer.js - About 2 days to fix

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

module.exports = function( THREE ) {
    /**
    * @author Eric Haines / http://erichaines.com/
    *
    * Tessellates the famous Utah teapot database by Martin Newell into triangles.
Severity: Minor
Found in csfieldguide/static/js/third-party/threejs/TeapotGeometry.js - About 2 days 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 assemble has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
Open

function assemble() {
    LABELS = [];
    LABELADDRS = [];
    var targetIndex;

Severity: Minor
Found in csfieldguide/static/interactives/mips-assembler/js/mips-assembler.js - About 1 day 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

File mips-simulator.js has 759 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Partial MIPS I Simulator based on the work of Alan Hogan
 * https://github.com/alanhogan/miphps-mips-simulator
 * Licensed under CC BY-NC-SA 4.0
 */

Severity: Major
Found in csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js - About 1 day to fix

File mips-assembler.js has 700 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Partial MIPS I Assembler based on the work of Alan Hogan
 * https://github.com/alanhogan/online-mips-assembler
 * Licensed under CC BY-NC-SA 4.0
 */

Severity: Major
Found in csfieldguide/static/interactives/mips-assembler/js/mips-assembler.js - About 1 day to fix

File 2d-shape-manipulations.js has 666 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var urlParameters = require('../../../js/third-party/url-parameters.js');

// ########################################################################## //
/* Configs (in alphabetical order) */

File product-code-check-digit-calculation.js has 657 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const JsBarcode = require('jsbarcode');
const arrowSVG = require('arrows-svg');
const arrowCreate = arrowSVG.default;
const arrowDirections = arrowSVG.DIRECTION;
const arrowHeads = arrowSVG.HEAD;

File scene-editor.js has 620 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** Parts of this file are heavily adapted from https://github.com/mrdoob/three.js/blob/dev/examples/webgl_materials_envmaps.html */

global.THREE = require('three');
const { create, all } = require('mathjs');
const mathjs = create(all, {});
Severity: Major
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 day to fix

File game.js has 619 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Packet Attack
 * 
 * Main Gameplay Classes
 */
Severity: Major
Found in csfieldguide/static/interactives/packet-attack/js/game.js - About 1 day to fix

File Scroller.js has 608 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Scroller
 * http://github.com/zynga/scroller
 *
 * Copyright 2011, Zynga Inc.

Function assemble has 218 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function assemble() {
    LABELS = [];
    LABELADDRS = [];
    var targetIndex;

Severity: Major
Found in csfieldguide/static/interactives/mips-assembler/js/mips-assembler.js - About 1 day to fix

Function highlightCodedCharacters has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
Open

function highlightCodedCharacters() {
    // clear the existing references
    for (var i = 0; i < message_characters.length; i++) {
        message_characters[i].CodeIndex = false;
        var character_element = document.querySelectorAll('[data-character-index="' + i.toString() + '"]')[0];

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

File cfg-parsing-challenge.js has 519 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var urlParameters = require('../../../js/third-party/url-parameters.js');

/**
* Productions in the default grammar.
* A number or a string that begins and ends with an inverted comma (') is

File shannon-experiment.js has 517 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const Chart = require('chart.js');
Chart.defaults.font.size = 14;
Chart.defaults.font.family = '"Noto Sans", sans-serif';

// This is not a constant as we remove sentences once they are completed.

File matrix-simplifier.js has 510 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const dragula = require('dragula');
const mathjs_import = require('mathjs');
const sprintf = require('sprintf-js').sprintf;
const vsprintf = require('sprintf-js').vsprintf;

File jpeg-compression.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const Interact = require('interactjs');
var urlParameters = require('../../../js/third-party/url-parameters.js');
require('./../../../js/third-party/jquery.stepper');
const dct = require('dct');

File training-ground.js has 498 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * trAIning ground
 * 
 * Creates and executes the game
 */

File translation-rotation.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Common source code for the box translation and rotation interactives
 */

var THREE = require('three');

File plane-turbulence.js has 473 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
* The airplane svg.
*/
let svg;

Severity
Category
Status
Source
Language