cra16/cake-core

View on GitHub

Showing 1,537 of 1,537 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Blockly.JavaScript['controls_for'] = function(block) {
  // For loop.
  var variable0 = Blockly.JavaScript.variableDB_.getName(
      block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
  var argument0 = Blockly.JavaScript.valueToCode(block, 'FROM',
Severity: Major
Found in generators/javascript/loops.js and 1 other location - About 5 days to fix
generators/dart/loops.js on lines 82..145

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 877.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Blockly.Dart['controls_for'] = function(block) {
  // For loop.
  var variable0 = Blockly.Dart.variableDB_.getName(
      block.getFieldValue('VAR'), Blockly.Variables.NAME_TYPE);
  var argument0 = Blockly.Dart.valueToCode(block, 'FROM',
Severity: Major
Found in generators/dart/loops.js and 1 other location - About 5 days to fix
generators/javascript/loops.js on lines 82..145

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 877.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Blockly.cake['lists_setIndex'] = function(block) {
  // Set element at index.
  // Note: Until February 2013 this block did not have MODE or WHERE inputs.
  var list = Blockly.cake.valueToCode(block, 'LIST',
      Blockly.cake.ORDER_MEMBER) || '[]';
Severity: Major
Found in generators/cake/lists.js and 1 other location - About 4 days to fix
generators/javascript/lists.js on lines 183..259

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 824.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Blockly.JavaScript['lists_setIndex'] = function(block) {
  // Set element at index.
  // Note: Until February 2013 this block did not have MODE or WHERE inputs.
  var list = Blockly.JavaScript.valueToCode(block, 'LIST',
      Blockly.JavaScript.ORDER_MEMBER) || '[]';
Severity: Major
Found in generators/javascript/lists.js and 1 other location - About 4 days to fix
generators/cake/lists.js on lines 183..259

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 824.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  for (var x = 0, xmlChild; xmlChild = xmlBlock.childNodes[x]; x++) {
    if (xmlChild.nodeType == 3 && xmlChild.data.match(/^\s*$/)) {
      // Extra whitespace between tags does not concern us.
      continue;
    }
Severity: Major
Found in core/xml.js and 1 other location - About 4 days to fix
core/xml.js on lines 461..546

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 695.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    for (var x = 0, xmlChild; xmlChild = xmlBlock.childNodes[x]; x++) {
        if (xmlChild.nodeType == 3 && xmlChild.data.match(/^\s*$/)) {
            // Extra whitespace between tags does not concern us.
            continue;
        }
Severity: Major
Found in core/xml.js and 1 other location - About 4 days to fix
core/xml.js on lines 294..379

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 695.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File bootstrap.js has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Bootstrap v3.2.0 (http://getbootstrap.com)
 * Copyright 2011-2014 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
Severity: Major
Found in js/bootstrap.js - About 3 days to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  dontRemoveFromWorkspace) {
  // Switch off rerendering.
  this.rendered = false;
  this.unplug(healStack);

Severity: Major
Found in core/block.js and 1 other location - About 3 days to fix
core/variables.js on lines 127..136

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 550.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File block.js has 1173 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 * Visual Blocks Editor
 *
 * Copyright 2011 Google Inc.
Severity: Major
Found in core/block.js - About 3 days to fix

File maze.js has 1163 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Blockly Apps: Maze
 *
 * Copyright 2012 Google Inc.
 * https://blockly.googlecode.com/
Severity: Major
Found in blockly/apps/maze/maze.js - About 2 days to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                else {
                    if(this.dist_[x]=='v'){
                        paramString = paramString + ', ' + this.types_[x] + ' ' + this.arguments_[x];
                    }
                    else if(this.dist_[x]=='a'){
Severity: Major
Found in blocks/procedures.js and 1 other location - About 2 days to fix
blocks/procedures.js on lines 208..223

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 475.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if (x == 0) {
                    if(this.dist_[x]=='v'){
                        paramString = paramString + ' ' + this.types_[x] + ' ' + this.arguments_[x];
                    }
                    else if(this.dist_[x]=='a'){
Severity: Major
Found in blocks/procedures.js and 1 other location - About 2 days to fix
blocks/procedures.js on lines 224..239

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 475.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function renderDrawRight_ has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
Open

Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps,
    inlineSteps, highlightInlineSteps, connectionsXY, inputRows, iconWidth) {
  var cursorX;
  var cursorY = 0;
  var connectionX, connectionY;
Severity: Minor
Found in core/block_svg.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

File soyutils.js has 1011 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2008 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Major
Found in blockly/apps/_soy/soyutils.js - About 2 days to fix

File procedures.js has 982 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license
 * Visual Blocks Editor
 *
 * Copyright 2012 Google Inc.
Severity: Major
Found in blocks/procedures.js - About 2 days to fix

Function levelHelp has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring.
Open

Maze.levelHelp = function() {
  if (Blockly.Block.dragMode_ != 0) {
    // Don't change helps during drags.
    return;
  } else if (Maze.result == Maze.ResultType.SUCCESS) {
Severity: Minor
Found in blockly/apps/maze/maze.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

Similar blocks of code found in 38 locations. Consider refactoring.
Open

planepage.start = function(opt_data, opt_ignored, opt_ijData) {
  var output = planepage.messages(null, null, opt_ijData) + '<table width="100%"><tr><td><h1><span id="title"><a href="../index.html?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '">قلف بیه</a> : زمی</span> &nbsp; ';
  var iLimit130 = opt_ijData.maxLevel + 1;
  for (var i130 = 1; i130 < iLimit130; i130++) {
    output += ' ' + ((i130 == opt_ijData.level) ? '<span class="tab" id="selected">' + soy.$$escapeHtml(i130) + '</span>' : (i130 < opt_ijData.level) ? '<a class="tab previous" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>' : '<a class="tab" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>');
Severity: Major
Found in blockly/apps/plane/generated/lrc.js and 37 other locations - About 2 days to fix
blockly/apps/plane/generated/af.js on lines 43..63
blockly/apps/plane/generated/ar.js on lines 43..63
blockly/apps/plane/generated/arz.js on lines 43..63
blockly/apps/plane/generated/az.js on lines 43..63
blockly/apps/plane/generated/bg.js on lines 43..63
blockly/apps/plane/generated/bn.js on lines 43..63
blockly/apps/plane/generated/cdo.js on lines 43..63
blockly/apps/plane/generated/cs.js on lines 43..63
blockly/apps/plane/generated/da.js on lines 43..63
blockly/apps/plane/generated/en.js on lines 43..63
blockly/apps/plane/generated/fa.js on lines 43..63
blockly/apps/plane/generated/fo.js on lines 43..63
blockly/apps/plane/generated/frr.js on lines 43..63
blockly/apps/plane/generated/hak.js on lines 43..63
blockly/apps/plane/generated/he.js on lines 43..63
blockly/apps/plane/generated/ja.js on lines 43..63
blockly/apps/plane/generated/ka.js on lines 43..63
blockly/apps/plane/generated/km.js on lines 43..63
blockly/apps/plane/generated/ko.js on lines 43..63
blockly/apps/plane/generated/ku-latn.js on lines 43..63
blockly/apps/plane/generated/ky.js on lines 43..63
blockly/apps/plane/generated/lt.js on lines 43..63
blockly/apps/plane/generated/mk.js on lines 43..63
blockly/apps/plane/generated/ml.js on lines 43..63
blockly/apps/plane/generated/mzn.js on lines 43..63
blockly/apps/plane/generated/nb.js on lines 43..63
blockly/apps/plane/generated/pa.js on lines 43..63
blockly/apps/plane/generated/ps.js on lines 43..63
blockly/apps/plane/generated/si.js on lines 43..63
blockly/apps/plane/generated/sk.js on lines 43..63
blockly/apps/plane/generated/ta.js on lines 43..63
blockly/apps/plane/generated/te.js on lines 43..63
blockly/apps/plane/generated/tzm.js on lines 43..63
blockly/apps/plane/generated/uk.js on lines 43..63
blockly/apps/plane/generated/vi.js on lines 43..63
blockly/apps/plane/generated/zh-hans.js on lines 43..63
blockly/apps/plane/generated/zh-hant.js on lines 43..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 378.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 38 locations. Consider refactoring.
Open

planepage.start = function(opt_data, opt_ignored, opt_ijData) {
  var output = planepage.messages(null, null, opt_ijData) + '<table width="100%"><tr><td><h1><span id="title"><a href="../index.html?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '">Blockly (Блоклі)</a> : Калькулятор місць у літаку</span> &nbsp; ';
  var iLimit130 = opt_ijData.maxLevel + 1;
  for (var i130 = 1; i130 < iLimit130; i130++) {
    output += ' ' + ((i130 == opt_ijData.level) ? '<span class="tab" id="selected">' + soy.$$escapeHtml(i130) + '</span>' : (i130 < opt_ijData.level) ? '<a class="tab previous" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>' : '<a class="tab" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>');
Severity: Major
Found in blockly/apps/plane/generated/uk.js and 37 other locations - About 2 days to fix
blockly/apps/plane/generated/af.js on lines 43..63
blockly/apps/plane/generated/ar.js on lines 43..63
blockly/apps/plane/generated/arz.js on lines 43..63
blockly/apps/plane/generated/az.js on lines 43..63
blockly/apps/plane/generated/bg.js on lines 43..63
blockly/apps/plane/generated/bn.js on lines 43..63
blockly/apps/plane/generated/cdo.js on lines 43..63
blockly/apps/plane/generated/cs.js on lines 43..63
blockly/apps/plane/generated/da.js on lines 43..63
blockly/apps/plane/generated/en.js on lines 43..63
blockly/apps/plane/generated/fa.js on lines 43..63
blockly/apps/plane/generated/fo.js on lines 43..63
blockly/apps/plane/generated/frr.js on lines 43..63
blockly/apps/plane/generated/hak.js on lines 43..63
blockly/apps/plane/generated/he.js on lines 43..63
blockly/apps/plane/generated/ja.js on lines 43..63
blockly/apps/plane/generated/ka.js on lines 43..63
blockly/apps/plane/generated/km.js on lines 43..63
blockly/apps/plane/generated/ko.js on lines 43..63
blockly/apps/plane/generated/ku-latn.js on lines 43..63
blockly/apps/plane/generated/ky.js on lines 43..63
blockly/apps/plane/generated/lrc.js on lines 43..63
blockly/apps/plane/generated/lt.js on lines 43..63
blockly/apps/plane/generated/mk.js on lines 43..63
blockly/apps/plane/generated/ml.js on lines 43..63
blockly/apps/plane/generated/mzn.js on lines 43..63
blockly/apps/plane/generated/nb.js on lines 43..63
blockly/apps/plane/generated/pa.js on lines 43..63
blockly/apps/plane/generated/ps.js on lines 43..63
blockly/apps/plane/generated/si.js on lines 43..63
blockly/apps/plane/generated/sk.js on lines 43..63
blockly/apps/plane/generated/ta.js on lines 43..63
blockly/apps/plane/generated/te.js on lines 43..63
blockly/apps/plane/generated/tzm.js on lines 43..63
blockly/apps/plane/generated/vi.js on lines 43..63
blockly/apps/plane/generated/zh-hans.js on lines 43..63
blockly/apps/plane/generated/zh-hant.js on lines 43..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 378.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 38 locations. Consider refactoring.
Open

planepage.start = function(opt_data, opt_ignored, opt_ijData) {
  var output = planepage.messages(null, null, opt_ijData) + '<table width="100%"><tr><td><h1><span id="title"><a href="../index.html?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '">Blockly</a> : 飛機座位計算器</span> &nbsp; ';
  var iLimit130 = opt_ijData.maxLevel + 1;
  for (var i130 = 1; i130 < iLimit130; i130++) {
    output += ' ' + ((i130 == opt_ijData.level) ? '<span class="tab" id="selected">' + soy.$$escapeHtml(i130) + '</span>' : (i130 < opt_ijData.level) ? '<a class="tab previous" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>' : '<a class="tab" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>');
Severity: Major
Found in blockly/apps/plane/generated/zh-hant.js and 37 other locations - About 2 days to fix
blockly/apps/plane/generated/af.js on lines 43..63
blockly/apps/plane/generated/ar.js on lines 43..63
blockly/apps/plane/generated/arz.js on lines 43..63
blockly/apps/plane/generated/az.js on lines 43..63
blockly/apps/plane/generated/bg.js on lines 43..63
blockly/apps/plane/generated/bn.js on lines 43..63
blockly/apps/plane/generated/cdo.js on lines 43..63
blockly/apps/plane/generated/cs.js on lines 43..63
blockly/apps/plane/generated/da.js on lines 43..63
blockly/apps/plane/generated/en.js on lines 43..63
blockly/apps/plane/generated/fa.js on lines 43..63
blockly/apps/plane/generated/fo.js on lines 43..63
blockly/apps/plane/generated/frr.js on lines 43..63
blockly/apps/plane/generated/hak.js on lines 43..63
blockly/apps/plane/generated/he.js on lines 43..63
blockly/apps/plane/generated/ja.js on lines 43..63
blockly/apps/plane/generated/ka.js on lines 43..63
blockly/apps/plane/generated/km.js on lines 43..63
blockly/apps/plane/generated/ko.js on lines 43..63
blockly/apps/plane/generated/ku-latn.js on lines 43..63
blockly/apps/plane/generated/ky.js on lines 43..63
blockly/apps/plane/generated/lrc.js on lines 43..63
blockly/apps/plane/generated/lt.js on lines 43..63
blockly/apps/plane/generated/mk.js on lines 43..63
blockly/apps/plane/generated/ml.js on lines 43..63
blockly/apps/plane/generated/mzn.js on lines 43..63
blockly/apps/plane/generated/nb.js on lines 43..63
blockly/apps/plane/generated/pa.js on lines 43..63
blockly/apps/plane/generated/ps.js on lines 43..63
blockly/apps/plane/generated/si.js on lines 43..63
blockly/apps/plane/generated/sk.js on lines 43..63
blockly/apps/plane/generated/ta.js on lines 43..63
blockly/apps/plane/generated/te.js on lines 43..63
blockly/apps/plane/generated/tzm.js on lines 43..63
blockly/apps/plane/generated/uk.js on lines 43..63
blockly/apps/plane/generated/vi.js on lines 43..63
blockly/apps/plane/generated/zh-hans.js on lines 43..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 378.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 38 locations. Consider refactoring.
Open

planepage.start = function(opt_data, opt_ignored, opt_ijData) {
  var output = planepage.messages(null, null, opt_ijData) + '<table width="100%"><tr><td><h1><span id="title"><a href="../index.html?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '">בלוקלי</a> : מחשבון מושב במטוס</span> &nbsp; ';
  var iLimit130 = opt_ijData.maxLevel + 1;
  for (var i130 = 1; i130 < iLimit130; i130++) {
    output += ' ' + ((i130 == opt_ijData.level) ? '<span class="tab" id="selected">' + soy.$$escapeHtml(i130) + '</span>' : (i130 < opt_ijData.level) ? '<a class="tab previous" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>' : '<a class="tab" href="?lang=' + soy.$$escapeHtml(opt_ijData.lang) + '&level=' + soy.$$escapeHtml(i130) + '">' + soy.$$escapeHtml(i130) + '</a>');
Severity: Major
Found in blockly/apps/plane/generated/he.js and 37 other locations - About 2 days to fix
blockly/apps/plane/generated/af.js on lines 43..63
blockly/apps/plane/generated/ar.js on lines 43..63
blockly/apps/plane/generated/arz.js on lines 43..63
blockly/apps/plane/generated/az.js on lines 43..63
blockly/apps/plane/generated/bg.js on lines 43..63
blockly/apps/plane/generated/bn.js on lines 43..63
blockly/apps/plane/generated/cdo.js on lines 43..63
blockly/apps/plane/generated/cs.js on lines 43..63
blockly/apps/plane/generated/da.js on lines 43..63
blockly/apps/plane/generated/en.js on lines 43..63
blockly/apps/plane/generated/fa.js on lines 43..63
blockly/apps/plane/generated/fo.js on lines 43..63
blockly/apps/plane/generated/frr.js on lines 43..63
blockly/apps/plane/generated/hak.js on lines 43..63
blockly/apps/plane/generated/ja.js on lines 43..63
blockly/apps/plane/generated/ka.js on lines 43..63
blockly/apps/plane/generated/km.js on lines 43..63
blockly/apps/plane/generated/ko.js on lines 43..63
blockly/apps/plane/generated/ku-latn.js on lines 43..63
blockly/apps/plane/generated/ky.js on lines 43..63
blockly/apps/plane/generated/lrc.js on lines 43..63
blockly/apps/plane/generated/lt.js on lines 43..63
blockly/apps/plane/generated/mk.js on lines 43..63
blockly/apps/plane/generated/ml.js on lines 43..63
blockly/apps/plane/generated/mzn.js on lines 43..63
blockly/apps/plane/generated/nb.js on lines 43..63
blockly/apps/plane/generated/pa.js on lines 43..63
blockly/apps/plane/generated/ps.js on lines 43..63
blockly/apps/plane/generated/si.js on lines 43..63
blockly/apps/plane/generated/sk.js on lines 43..63
blockly/apps/plane/generated/ta.js on lines 43..63
blockly/apps/plane/generated/te.js on lines 43..63
blockly/apps/plane/generated/tzm.js on lines 43..63
blockly/apps/plane/generated/uk.js on lines 43..63
blockly/apps/plane/generated/vi.js on lines 43..63
blockly/apps/plane/generated/zh-hans.js on lines 43..63
blockly/apps/plane/generated/zh-hant.js on lines 43..63

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 378.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language