utensil/lol-model-format

View on GitHub

Showing 9 of 9 total issues

Method to_dae has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            def to_dae(model_name = nil)
                @model = {}

                positions = []
                normals = []
Severity: Major
Found in lib/lol_model_format/dae/dae_model.rb - About 2 hrs to fix

    File lol_model.rb has 277 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'lol_model_format/skl_file'
    require 'lol_model_format/skn_file'
    require 'lol_model_format/anm_file'
    require "erb"
    require "haml"
    Severity: Minor
    Found in lib/lol_model_format/lol_model.rb - About 2 hrs to fix

      Method get_vertices_from_skl has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def get_vertices_from_skl(skl, offset)
                  vertices = []
                  
                  skl.bones.each do |i, b|
                      
      Severity: Major
      Found in lib/lol_model_format/lol_model.rb - About 2 hrs to fix

        Method get_animated_vertice_frames has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def get_animated_vertice_frames(vertices, anm_file)
                    vertice_frames = []
                    
                    #0.upto anm_file.number_of_frames - 1 do |frame_index|
                    0.upto 5 do |frame_index|
        Severity: Minor
        Found in lib/lol_model_format/lol_model.rb - About 1 hr to fix

          Method get_md2_skl_trianles has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      def get_md2_skl_trianles(count)
                          triangles = []
                          
                          0.upto count do |i|
                              
          Severity: Minor
          Found in lib/lol_model_format/md2/md2_model.rb - About 1 hr to fix

            Method to_md2_skl has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        def to_md2_skl
                            md2 = Md2File.new
                            
                            #TODO make skin size configurable
                            md2.header.skinwidth = 512
            Severity: Minor
            Found in lib/lol_model_format/md2/md2_model.rb - About 1 hr to fix

              Method get_vertices_from_skl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      def get_vertices_from_skl(skl, offset)
                          vertices = []
                          
                          skl.bones.each do |i, b|
                              
              Severity: Minor
              Found in lib/lol_model_format/lol_model.rb - About 35 mins 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

              Method absolutify! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                          def absolutify!
                              return if absolute?                
                              
                              
                              local_transform = RMtx4.new.rotationQuaternion(@orientation)      
              Severity: Minor
              Found in lib/lol_model_format/lol_model.rb - About 25 mins 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

              Method remap_bone_index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                      def remap_bone_index(bone_index_orig)
              
                          bone_index = 0
              
                          bone_index_orig = bone_index_orig.to_i
              Severity: Minor
              Found in lib/lol_model_format/lol_model.rb - About 25 mins 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