jardiacaj/finem_imperii

View on GitHub

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;
Severity: Minor
Found in base/static/base/3rd/OrbitControls.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

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;
Severity: Major
Found in base/static/base/3rd/OrbitControls.js - About 2 days to fix

    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:
    Severity: Minor
    Found in organization/models/capability.py - About 1 day 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 BattleRenderer has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring.
    Open

    function BattleRenderer(battle_data) {
    
        var zis = this;
    
        /* API */
    Severity: Minor
    Found in battle/static/battle/battle_renderer.js - About 1 day 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 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()
    Severity: Minor
    Found in battle/battle_tick.py - About 1 day 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 BattleRenderer has 226 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function BattleRenderer(battle_data) {
    
        var zis = this;
    
        /* API */
    Severity: Major
    Found in battle/static/battle/battle_renderer.js - About 1 day to fix

      Function MapRenderer has 209 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function MapRenderer(world_data) {
      
          var zis = this;
      
          /* API */
      Severity: Major
      Found in world/static/world/world_renderer.js - About 1 day to fix

        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
        
        
        Severity: Major
        Found in messaging/tests.py - About 1 day to fix

          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
          Severity: Minor
          Found in base/static/base/3rd/OrbitControls.js - About 7 hrs to fix

            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
            
            
            Severity: Minor
            Found in organization/models/capability.py - About 7 hrs to fix

              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(
              Severity: Minor
              Found in battle/battle_tick.py - About 7 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 MapRenderer has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
              Open

              function MapRenderer(world_data) {
              
                  var zis = this;
              
                  /* API */
              Severity: Minor
              Found in world/static/world/world_renderer.js - About 7 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

              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
              
              
              Severity: Minor
              Found in character/models.py - About 6 hrs to fix

                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
                Severity: Minor
                Found in battle/battle_tick.py - About 6 hrs to fix

                  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 = {}
                  Severity: Minor
                  Found in battle/battle_renderer.py - 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

                  Character has 41 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Character(models.Model, AdminURLMixin):
                      COMMANDER = 'commander'
                      TRADER = 'trader'
                      BUREAUCRAT = 'bureaucrat'
                      PROFILE_CHOICES = (
                  Severity: Minor
                  Found in character/models.py - About 5 hrs to fix

                    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(
                    Severity: Minor
                    Found in turn/battle.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 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) + \
                    Severity: Minor
                    Found in battle/battle_init.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 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
                    
                    
                    Severity: Minor
                    Found in battle/battle_tick.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 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 = {};
                    Severity: Minor
                    Found in base/static/base/base_renderer.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