cra16/cake-core

View on GitHub

Showing 621 of 1,537 total issues

File blockly.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 * Visual Blocks Editor
 *
 * Copyright 2011 Google Inc.
Severity: Minor
Found in core/blockly.js - About 5 hrs to fix

File realtime.js has 387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 * Visual Blocks Editor
 *
 * Copyright 2014 Google Inc.
Severity: Minor
Found in core/realtime.js - About 5 hrs to fix

Function drawMap has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

Maze.drawMap = function() {
  var svg = document.getElementById('svgMaze');
  var scale = Math.max(Maze.ROWS, Maze.COLS) * Maze.SQUARE_SIZE;
  svg.setAttribute('viewBox', '0 0 ' + scale + ' ' + scale);

Severity: Minor
Found in blockly/apps/maze/maze.js - About 5 hrs 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 onchange has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    onchange: function() {
        if (this.getInputTargetBlock('VALUE'))
        {
            var nextblock = this.getInputTargetBlock('VALUE');

Severity: Minor
Found in blocks/variables.js - About 5 hrs 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 drawMap has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Maze.drawMap = function() {
  var svg = document.getElementById('svgMaze');
  var scale = Math.max(Maze.ROWS, Maze.COLS) * Maze.SQUARE_SIZE;
  svg.setAttribute('viewBox', '0 0 ' + scale + ' ' + scale);

Severity: Major
Found in blockly/apps/maze/maze.js - About 5 hrs to fix

Function domToBlock has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Blockly.Xml.domToBlock = function(workspace, xmlBlock, opt_reuseBlock) {
  var block = null;
  var prototypeName = xmlBlock.getAttribute('type');
  if (!prototypeName) {
    throw 'Block type unspecified: \n' + xmlBlock.outerHTML;
Severity: Major
Found in core/xml.js - About 5 hrs to fix

File stdio.js has 383 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

goog.provide('Blockly.cake.stdio');

goog.require('Blockly.cake');
Severity: Minor
Found in generators/cake/stdio.js - About 5 hrs to fix

File messages.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 * Visual Blocks Language
 *
 * Copyright 2012 Google Inc.
Severity: Minor
Found in msg/messages.js - About 5 hrs to fix

Function getFields has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

function getFields(block) {
  var fields = [];
  while (block) {
    if (!block.disabled && !block.getInheritedDisabled()) {
      switch (block.type) {
Severity: Minor
Found in blockly/apps/blockfactory/factory.js - About 5 hrs 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 domToBlockObject has 127 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Blockly.Xml.domToBlockObject = function(workspace, xmlBlock, opt_reuseBlock) {
    var block = null;
    var prototypeName = xmlBlock.getAttribute('type');
    if (!prototypeName) {
        throw 'Block type unspecified: \n' + xmlBlock.outerHTML;
Severity: Major
Found in core/xml.js - About 5 hrs to fix

File stdio.js has 377 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

goog.provide('Blockly.Blocks.stdio');

goog.require('Blockly.Blocks');
Severity: Minor
Found in blocks/stdio.js - About 5 hrs to fix

File factory.js has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Blockly Apps: Block Factory
 *
 * Copyright 2012 Google Inc.
 * https://blockly.googlecode.com/
Severity: Minor
Found in blockly/apps/blockfactory/factory.js - About 4 hrs to fix

File no.js has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This file was automatically generated.  Do not modify.

'use strict';

goog.provide('Blockly.Msg.no');
Severity: Minor
Found in msg/js/no.js - About 4 hrs to fix

File az-latn.js has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This file was automatically generated.  Do not modify.

'use strict';

goog.provide('Blockly.Msg.az-latn');
Severity: Minor
Found in msg/js/az-latn.js - About 4 hrs to fix

File flyout.js has 360 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 * Visual Blocks Editor
 *
 * Copyright 2011 Google Inc.
Severity: Minor
Found in core/flyout.js - About 4 hrs to fix

Function searchTag has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

Blockly.Blocks.searchTag = function(searchingTag){
    var tree = Blockly.Toolbox.tree_;
    var blocks = [];
    for (var i = 0; i<tree.children_.length; i++) {
        var tree_i =tree.children_[i];
Severity: Minor
Found in core/blocks.js - About 4 hrs 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 output_as_html has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

def output_as_html(messages, apps, verbose):
  """Outputs the given prefix counts and percentages as HTML.

  Specifically, a sortable HTML table is produced, where the app names
  are column headers, and one language is output per row.  Entries
Severity: Minor
Found in i18n/status.py - About 4 hrs 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 renderCompute_ has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Blockly.BlockSvg.prototype.renderCompute_ = function(iconWidth) {
  var inputList = this.block_.inputList;
  var inputRows = [];
  inputRows.rightEdge = iconWidth + Blockly.BlockSvg.SEP_SPACE_X * 2;
  if (this.block_.previousConnection || this.block_.nextConnection) {
Severity: Major
Found in core/block_svg.js - About 4 hrs to fix

Function updateLanguage has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

function updateLanguage() {
  // Generate name.
  var code = [];
  code.push("Blockly.Blocks['" + blockType + "'] = {");
  var rootBlock = getRootBlock();
Severity: Minor
Found in blockly/apps/blockfactory/factory.js - About 4 hrs 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 setProcedureParameters has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    setProcedureParameters: function(paramNames, paramTypes, paramDist, paramSpec, paramIds) {
        // Data structures:
        // this.arguments = ['x', 'y']
        //     Existing param names.
        // this.quarkConnections_ {piua: null, f8b_: Blockly.Connection}
Severity: Minor
Found in blocks/procedures.js - About 4 hrs 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

Severity
Category
Status
Source
Language