Showing 14 of 185 total issues
Function assemble
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
var assemble = function (src, size) {
/** The Project Control group */
var pcGroup = new RegExp("^(JMP|RET|CALL)$|^[JRC]{1}(NZ|NC|PO|P|Z|P|PE|M)$");
/** The math group, needs immed value */
- 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 MolassesRegisters
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function MolassesRegisters () {
return {
memory: null,
/**
* The 8-bit A (Accumulator) Register
- 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 assemble
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
var assemble = function (src, size) {
/** The Project Control group */
var pcGroup = new RegExp("^(JMP|RET|CALL)$|^[JRC]{1}(NZ|NC|PO|P|Z|P|PE|M)$");
/** The math group, needs immed value */
Function Memory
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function Memory (s, mem_type) {
// Validate size parameter
if (s < 1) {
throw new Error("Memory must have at least 1 byte.");
- 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 MolassesRegisters
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MolassesRegisters () {
return {
memory: null,
/**
* The 8-bit A (Accumulator) Register
`` has 30 functions (exceeds 20 allowed). Consider refactoring. Open
return {
memory: null,
/**
* The 8-bit A (Accumulator) Register
*/
Function exports
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
Function Memory
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Memory (s, mem_type) {
// Validate size parameter
if (s < 1) {
throw new Error("Memory must have at least 1 byte.");
Function preprocess
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
var preprocess = function (src) {
/** Preprocessor FSM states */
var state = new WaitState('');
- 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 Molasses8080
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Molasses8080 (memory) {
/** General, flag, program, stack registers */
var reg = MolassesRegisters();
/** The Memory of the cpu: 256 mb */
var mem = (reg.memory = (memory || new Memory(256)));
Function preprocess
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
var preprocess = function (src) {
/** Preprocessor FSM states */
var state = new WaitState('');
Function NumberState
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var NumberState = function (char) {
this.name = "NUMBER";
var content = char;
this.nextNumber = function (char) {
// add number to number
Function NumberState
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var NumberState = function (char) {
this.name = "NUMBER";
var content = char;
this.nextNumber = function (char) {
// add number to number
- 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 WaitState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var WaitState = function (char) {
this.name = "WAIT";
var content = char;
this.nextNumber = function (char) {
return { state: new NumberState(char), bin: content};
- 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"