realitix/vulk

View on GitHub

Showing 62 of 152 total issues

File vulkanobject.py has 2051 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'''Vulkan objects modules

This module contains the *High* level Vulkan object. It's not that *high*
level, you need to understand fully Vulkan to use theses objects.
This module must be use by Vulkan expert and is very complicated to work with.
Severity: Major
Found in vulk/vulkanobject.py - About 5 days to fix

    File context.py has 707 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Module to create Window and Vulkan context
    
    This module contains class to create the SDL2 window and the Vulkan
    logical device and queues.
    The context will be then passed to the Application to use it.
    Severity: Major
    Found in vulk/context.py - About 1 day to fix

      File batch.py has 687 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      '''BaseBatch module
      
      BaseBatch is used by SpriteBatch and BlockBatch.
      '''
      from abc import ABC, abstractmethod
      Severity: Major
      Found in vulk/graphic/d2/batch.py - About 1 day to fix

        File vulkanconstant.py has 630 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        '''
        This module contains useful mapping or constants.
        
        Vulkan enum are translated to Python enum.
        There are two types of enumeration, `IntEnum` and `IntFlag`.
        Severity: Major
        Found in vulk/vulkanconstant.py - About 1 day to fix

          Function _create_swapchain has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              def _create_swapchain(self):
                  """Create Vulkan swapchain"""
                  surface_capabilities = self.pfn['vkGetPhysicalDeviceSurfaceCapabilitiesKHR'](self.physical_device, self.surface) # noqa
                  surface_formats = self.pfn['vkGetPhysicalDeviceSurfaceFormatsKHR'](self.physical_device, self.surface) # noqa
                  surface_present_modes = self.pfn['vkGetPhysicalDeviceSurfacePresentModesKHR'](self.physical_device, self.surface) # noqa
          Severity: Minor
          Found in vulk/context.py - About 3 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

          VulkContext has 25 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class VulkContext():
              def __init__(self, window, debug=False, extra_layers=None):
                  """Create context
          
                  Args:
          Severity: Minor
          Found in vulk/context.py - About 2 hrs to fix

            Vector has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Vector():
                '''Base class for Vector
            
                *Exemple:*
            
            
            Severity: Minor
            Found in vulk/math/vector.py - About 2 hrs to fix

              File vector.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              '''Vector module
              
              This module contains all Vector classes definition.
              Vector are a key of graphic computing.
              '''
              Severity: Minor
              Found in vulk/math/vector.py - About 2 hrs to fix

                Function load_bmfont has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    def load_bmfont(filepath):
                        """Convert the BMFont file into a dict
                
                        Args:
                            filename (str): BMFont file
                Severity: Minor
                Found in vulk/graphic/d2/font.py - About 2 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 texture.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                '''
                This module allows to load texture and to sample from it
                '''
                import numpy as np
                from vulkbare import load_image, resize_image
                Severity: Minor
                Found in vulk/graphic/texture.py - About 2 hrs to fix

                  Function draw has 16 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def draw(self, texture, x, y, width=0, height=0, u=0, v=0, u2=1, v2=1,
                  Severity: Major
                  Found in vulk/graphic/d2/batch.py - About 2 hrs to fix

                    Function __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, context, mag_filter, min_filter, mipmap_mode,
                    Severity: Major
                    Found in vulk/vulkanobject.py - About 2 hrs to fix

                      Function __init__ has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def __init__(self, context, attachments, subpasses, dependencies):
                              """Renderpass constructor
                      
                              Args:
                                  context (VulkContext)
                      Severity: Minor
                      Found in vulk/vulkanobject.py - About 1 hr 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 __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, context, image_type, image_format, width, height, depth,
                      Severity: Major
                      Found in vulk/vulkanobject.py - About 1 hr to fix

                        Function draw_region has 12 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def draw_region(self, region, x, y, width, height, r=1, g=1, b=1, a=1,
                        Severity: Major
                        Found in vulk/graphic/d2/batch.py - About 1 hr to fix

                          Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(self, context, stages, vertex_input, input_assembly,
                          Severity: Major
                          Found in vulk/vulkanobject.py - About 1 hr to fix

                            Function __init__ has 12 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(self, name='Vulk', x=-1, y=-1, width=640, height=480,
                            Severity: Major
                            Found in vulk/baseapp.py - About 1 hr to fix

                              Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(self, context, image_type, image_format, width, height,
                              Severity: Major
                              Found in vulk/vulkanobject.py - About 1 hr to fix

                                Function draw_char has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def draw_char(self, fontdata, char, x, y, r=1., g=1., b=1., a=1.,
                                Severity: Major
                                Found in vulk/graphic/d2/batch.py - About 1 hr to fix

                                  Function update_descriptorsets has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def update_descriptorsets(context, writes, copies):
                                      '''
                                      Update the contents of a descriptor set object
                                  
                                      *Parameters:*
                                  Severity: Minor
                                  Found in vulk/vulkanobject.py - About 1 hr 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