Showing 1,359 of 1,362 total issues
File codemirror.js
has 6179 lines of code (exceeds 250 allowed). Consider refactoring. Open
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
File raphael.js
has 5649 lines of code (exceeds 250 allowed). Consider refactoring. Open
// ┌────────────────────────────────────────────────────────────────────┐ \\
// │ Raphaël 2.1.2 - JavaScript Vector Library │ \\
// ├────────────────────────────────────────────────────────────────────┤ \\
// │ Copyright © 2008-2012 Dmitry Baranovskiy (http://raphaeljs.com) │ \\
// │ Copyright © 2008-2012 Sencha Labs (http://sencha.com) │ \\
File 0001_squashed_0025_levels_ordering_pt1.py
has 4781 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import unicode_literals
from builtins import range
from django.db import models, migrations
from django.conf import settings
Function LevelEditor
has a Cognitive Complexity of 620 (exceeds 5 allowed). Consider refactoring. Open
ocargo.LevelEditor = function(levelId) {
/*************/
/* Constants */
/*************/
- 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 LevelEditor
has 2076 lines of code (exceeds 25 allowed). Consider refactoring. Open
ocargo.LevelEditor = function(levelId) {
/*************/
/* Constants */
/*************/
File messages.py
has 2124 lines of code (exceeds 250 allowed). Consider refactoring. Open
from builtins import str
def level_creation_email_subject():
return "Custom level to moderate"
File level_editor.js
has 2104 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var ocargo = ocargo || {};
ocargo.LevelEditor = function(levelId) {
Function Drawing
has a Cognitive Complexity of 205 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Drawing = function (startingPosition) {
/*************/
/* Constants */
/*************/
- 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 Drawing
has 803 lines of code (exceeds 25 allowed). Consider refactoring. Open
ocargo.Drawing = function (startingPosition) {
/*************/
/* Constants */
/*************/
Function factory
has 725 lines of code (exceeds 25 allowed). Consider refactoring. Open
var factory = function( $, DataTable ) {
"use strict";
/**
* When making use of DataTables' x-axis scrolling feature, you may wish to
File handlebars.runtime-v4.7.7.js
has 1146 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**!
@license
handlebars v4.7.7
File game.js
has 1131 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
var ocargo = ocargo || {}
ocargo.Game = function () {
Function setupToolbox
has 550 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupToolbox() {
var tabs = [];
var currentTabSelected = null;
tabs.play = new ocargo.Tab($('#play_radio'), $("#run-code-button"), $('#play_radio + label'));
Similar blocks of code found in 2 locations. Consider refactoring. Open
ocargo.Map.prototype.isRoadRight = function(position) {
var previousNode = position.previousNode;
var currentNode = position.currentNode;
var nextCoordinates = {};
- Read upRead up
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 467.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
ocargo.Map.prototype.isRoadLeft = function(position) {
var previousNode = position.previousNode;
var currentNode = position.currentNode;
var nextCoordinates = {};
- Read upRead up
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 467.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
TestPlayThrough
has 137 functions (exceeds 20 allowed). Consider refactoring. Open
class TestPlayThrough(BaseGameTest):
def setUp(self):
self.login_once()
def _complete_episode(self, episode_number, level_number, **kwargs):
File drawing.js
has 1018 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
var ocargo = ocargo || {}
let GRID_WIDTH = 10
Similar blocks of code found in 2 locations. Consider refactoring. Open
'[{"coordinate":[1,4],"connectedNodes":[1]},'
+ '{"coordinate":[2,4],"connectedNodes":[0,2]},'
+ '{"coordinate":[2,5],"connectedNodes":[3,1]},'
+ '{"coordinate":[3,5],"connectedNodes":[2,4,20]},'
+ '{"coordinate":[4,5],"connectedNodes":[3,5]},'
- Read upRead up
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 253.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
level74.path = (
'[{"coordinate":[9,2],"connectedNodes":[1]},'
+ '{"coordinate":[8,2],"connectedNodes":[2,9,0]},'
+ '{"coordinate":[7,2],"connectedNodes":[1,3]},'
+ '{"coordinate":[7,1],"connectedNodes":[4,2]},'
- Read upRead up
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 253.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function initCustomBlocksDescription
has 441 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initCustomBlocksDescription() {
Blockly.Blocks["start"] = {
// Beginning block - identifies the start of the program
init: function () {
ocargo.blocklyControl.numStartBlocks++;