Showing 105 of 336 total issues
Function OrbitControls
has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring. Open
THREE.OrbitControls = function ( object, domElement ) {
this.object = object;
this.domElement = ( domElement !== undefined ) ? domElement : document;
- 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 OrbitControls
has 425 lines of code (exceeds 25 allowed). Consider refactoring. Open
THREE.OrbitControls = function ( object, domElement ) {
this.object = object;
this.domElement = ( domElement !== undefined ) ? domElement : document;
Function execute
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def execute(self):
proposal = self.get_proposal_json_content()
applying_to = self.capability.applying_to
if self.capability.type == Capability.POLICY_DOCUMENT:
try:
- 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 BattleRenderer
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
function BattleRenderer(battle_data) {
var zis = this;
/* API */
- 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 create_next_turn
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
def create_next_turn(battle: Battle):
new_turn = battle.get_latest_turn()
new_turn.id = None
new_turn.num += 1
new_turn.save()
- 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 BattleRenderer
has 226 lines of code (exceeds 25 allowed). Consider refactoring. Open
function BattleRenderer(battle_data) {
var zis = this;
/* API */
Function MapRenderer
has 209 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MapRenderer(world_data) {
var zis = this;
/* API */
File tests.py
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.contrib import auth
from django.contrib.auth.models import User
from django.test import TestCase
from django.urls.base import reverse
File OrbitControls.js
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
File capability.py
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
from django.db import models
from django.urls import reverse
Function get_target_distance_function
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
def get_target_distance_function(battle_contubernium_in_turn: BattleContuberniumInTurn):
order = battle_contubernium_in_turn.battle_unit_in_turn.battle_unit.get_order()
enemy_contubernia = BattleContuberniumInTurn.objects.filter(
battle_turn=battle_contubernium_in_turn.battle_turn
).exclude(
- 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 MapRenderer
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function MapRenderer(world_data) {
var zis = this;
/* API */
- 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 models.py
has 440 lines of code (exceeds 250 allowed). Consider refactoring. Open
import math
from django.contrib.auth.models import User
from django.db import models, transaction
File battle_tick.py
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
import math
import random
import django
from django.db import transaction
Function render_battle_for_view
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def render_battle_for_view(battle: Battle):
organizations = {}
characters = {}
units = {}
contubernia = {}
- 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
Character
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class Character(models.Model, AdminURLMixin):
COMMANDER = 'commander'
TRADER = 'trader'
BUREAUCRAT = 'bureaucrat'
PROFILE_CHOICES = (
Function battle_joins
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def battle_joins(battle: Battle):
for candidate_unit in battle_ready_units_in_tile(battle.tile):
candidate_vm = candidate_unit.get_violence_monopoly()
try:
battle_org = BattleOrganization.objects.get(
- 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 output_formation
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def output_formation(self):
widest_main_line_width = max([line.width for line in self.main_lines])
full_size_of_line = (self.formation_object.element_size +
self.formation_object.spacing)
flanks_x_offset = round(widest_main_line_width / 2) + \
- 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 find_path
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def find_path(battle_contubernium_in_turn: BattleContuberniumInTurn, target_distance_function, tile_availability_test) -> list:
starting_coordinates = battle_contubernium_in_turn.coordinates()
if target_distance_function(starting_coordinates) <= 0:
return True
- 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 BaseRenderer
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function BaseRenderer(initial_camera_x, initial_camera_y, initial_camera_z) {
var zis = this;
zis.picking_types = {};
- 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"