Showing 697 of 1,371 total issues
Avoid too many return
statements within this function. Open
return recipient_profile.student.class_field.teacher.school == sharer_profile.teacher.school
Avoid too many return
statements within this function. Open
return recipient_profile.teacher.school == sharer_profile.teacher.school
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return scoreboard_view(
Avoid too many return
statements within this function. Open
return level.default and not level.episode.in_development
Function deleteWorkspace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Saving.prototype.deleteWorkspace = function (id, callback) {
csrftoken = Cookies.get('csrftoken');
if (USER_STATUS === 'TEACHER' || USER_STATUS === 'SCHOOL_STUDENT' || USER_STATUS === 'INDEPENDENT_STUDENT') {
$.ajax({
url: Urls.delete_workspace(id),
- 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 PathFinder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.PathFinder = function(model) {
this.van = model.van;
this.nodes = model.map.nodes;
this.destinations = model.map.destinations;
- 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 initCustomBlocksDescription
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function initCustomBlocksDescription() {
Blockly.Blocks["start"] = {
// Beginning block - identifies the start of the program
init: function () {
ocargo.blocklyControl.numStartBlocks++;
- 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 moveVan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Model.prototype.moveVan = function(nextNode, action) {
// Crash?
let currentNodeHasCow = this.getCowForNode(this.van.getPosition().currentNode, [ocargo.Cow.ACTIVE, ocargo.Cow.READY]);
if (currentNodeHasCow) {
- 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 mobileGetCondition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.BlocklyCompiler.prototype.mobileGetCondition = function (
conditionBlock
) {
if (conditionBlock.type === "road_exists") {
var selection = conditionBlock.inputList[0].fieldRow[1].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 _setupStepTab
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Game.prototype._setupStepTab = function () {
this.tabs.step.setOnChange(
function () {
if (this.tabs.play.isInState('readyToPlay')) {
this._resetAndPrepareAnimation()
- 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 get_decor_element
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_decor_element(name, theme):
"""Helper method to get a decor element corresponding to the theme or a default one."""
try:
return DECOR_DATA[(name, theme.name)]
except KeyError:
- 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 play_anonymous_level
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def play_anonymous_level(request, levelId, from_level_editor=True, random_level=False):
night_mode = (
False if not app_settings.NIGHT_MODE_FEATURE_ENABLED else "night" in request.GET
)
level = Level.objects.filter(id=levelId)
- 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 _setupConsoleLogViewSliderListeners
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Game.prototype._setupConsoleLogViewSliderListeners = function () {
let startEvents = ['mousedown', 'touchstart']
let moveEvents = ['mousemove', 'touchmove']
let endEvents = ['mouseup', 'touchend', 'touchcancel']
- 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 add_levels_80_to_107
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_levels_80_to_107(apps, schema_editor):
Level = apps.get_model("game", "Level")
Episode = apps.get_model("game", "Episode")
Theme = apps.get_model("game", "Theme")
- 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 _setupPythonViewSliderListeners
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Game.prototype._setupPythonViewSliderListeners = function () {
let startEvents = ['mousedown', 'touchstart']
let moveEvents = ['mousemove', 'touchmove']
let endEvents = ['mouseup', 'touchend', 'touchcancel']
- 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 _setupLoadTab
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
ocargo.Game.prototype._setupLoadTab = function () {
var selectedWorkspace = null
this.tabs.load.setOnChange(
function () {
this.changeTabSelectionTo(this.tabs.load)
- 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"