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.
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.
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
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`.
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
- 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
VulkContext
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class VulkContext():
def __init__(self, window, debug=False, extra_layers=None):
"""Create context
Args:
Vector
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Vector():
'''Base class for Vector
*Exemple:*
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.
'''
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
- 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 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
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,
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, context, mag_filter, min_filter, mipmap_mode,
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)
- 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 __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, context, image_type, image_format, width, height, depth,
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,
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, context, stages, vertex_input, input_assembly,
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name='Vulk', x=-1, y=-1, width=640, height=480,
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, context, image_type, image_format, width, height,
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.,
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:*
- 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"