Showing 241 of 478 total issues
File DisplayedCircuit.js
has 1126 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File Matrix.js
has 891 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File CircuitDefinition.js
has 738 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File Seq.js
has 629 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Matrix
has 70 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Matrix {
/**
* @param {int} width
* @param {int} height
* @param {!Float64Array|!Float32Array} buffer Complex value data, packed row-wise with real and imaginary
DisplayedCircuit
has 61 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DisplayedCircuit {
/**
*
* @param {!number} top
* @param {!CircuitDefinition} circuitDefinition
Seq
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Seq {
/**
* Wraps the given array, collection, or other iterable.
* Use fromGenerator for wrapping generator functions.
*
CircuitDefinition
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CircuitDefinition {
/**
* @param {!int} numWires
* @param {!Array.<!GateColumn>} columns
* @param {undefined|!int=} outerRowOffset
Function initForge
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initForge(revision, obsIsAnyOverlayShowing) {
const obsOnShown = obsForgeIsShowing.filter(e => e === true);
/** @type {!String} */
let latestInspectorText;
revision.latestActiveCommit().subscribe(e => { latestInspectorText = e; });
Function exports
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
//noinspection JSUnresolvedFunction
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
traceur: {
File Gate.js
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File MathPainter.js
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
GateBuilder
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class GateBuilder {
constructor() {
this.gate = new Gate();
}
Rect
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Rect {
/**
* @param {!number} x
* @param {!number} y
* @param {!number} w
Function parseFormula
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
Open
function parseFormula(text, tokenMap) {
let tokens = _tokenize(text).map(e => _translate_token(e, tokenMap));
// Cut off trailing operation, so parse fails less often as users are typing.
if (tokens.length > 0 && tokens[tokens.length - 1].priority !== undefined) {
- 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
File GatePainting.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function initExports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initExports(revision, mostRecentStats, obsIsAnyOverlayShowing) {
// Show/hide exports overlay.
(() => {
const exportButton = /** @type {!HTMLButtonElement} */ document.getElementById('export-button');
const exportOverlay = /** @type {!HTMLDivElement} */ document.getElementById('export-overlay');
File forge.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File AllGates.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File ParametrizedRotationGates.js
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.