realitix/vulk

View on GitHub

Showing 152 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          class PipelineStage(IntFlag):
              NONE = 0
              TOP_OF_PIPE = vk.VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT
              DRAW_INDIRECT = vk.VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT
              VERTEX_INPUT = vk.VK_PIPELINE_STAGE_VERTEX_INPUT_BIT
          Severity: Major
          Found in vulk/vulkanconstant.py and 1 other location - About 1 day to fix
          vulk/vulkanconstant.py on lines 27..45

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 128.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          class Access(IntFlag):
              NONE = 0
              INDIRECT_COMMAND_READ = vk.VK_ACCESS_INDIRECT_COMMAND_READ_BIT
              INDEX_READ = vk.VK_ACCESS_INDEX_READ_BIT
              VERTEX_ATTRIBUTE_READ = vk.VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT
          Severity: Major
          Found in vulk/vulkanconstant.py and 1 other location - About 1 day to fix
          vulk/vulkanconstant.py on lines 573..591

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 128.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  with self.cbpool.pull() as cmd:
                      width = self.context.width
                      height = self.context.height
                      cmd.begin_renderpass(
                          self.renderpass,
          Severity: Major
          Found in vulk/graphic/d2/batch.py and 1 other location - About 1 day to fix
          vulk/graphic/d3/batch.py on lines 27..42

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  with self.cbpool.pull() as cmd:
                      width = self.context.width
                      height = self.context.height
                      cmd.begin_renderpass(
                          self.renderpass,
          Severity: Major
          Found in vulk/graphic/d3/batch.py and 1 other location - About 1 day to fix
          vulk/graphic/d2/batch.py on lines 740..755

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  with vo.immediate_buffer(self) as cmd:
                      self.final_image.update_layout(
                          cmd, vc.ImageLayout.UNDEFINED,
                          vc.ImageLayout.TRANSFER_DST_OPTIMAL,
                          vc.PipelineStage.BOTTOM_OF_PIPE,
          Severity: Major
          Found in vulk/context.py and 1 other location - About 7 hrs to fix
          vulk/context.py on lines 848..867

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 112.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  with vo.immediate_buffer(self) as cmd:
                      self.final_image.update_layout(
                          cmd,
                          vc.ImageLayout.COLOR_ATTACHMENT_OPTIMAL,
                          vc.ImageLayout.TRANSFER_DST_OPTIMAL,
          Severity: Major
          Found in vulk/context.py and 1 other location - About 7 hrs to fix
          vulk/context.py on lines 688..704

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 112.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          class VertexAttributes():
              def __init__(self, attributes):
                  '''
                  *Parameters:*
          
          
          Severity: Major
          Found in vulk/graphic/mesh.py and 1 other location - About 5 hrs to fix
          vulk/graphic/uniform.py on lines 26..48

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 88.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          class UniformAttributes():
              def __init__(self, attributes):
                  '''
                  *Parameters:*
          
          
          Severity: Major
          Found in vulk/graphic/uniform.py and 1 other location - About 5 hrs to fix
          vulk/graphic/mesh.py on lines 26..45

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 88.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          class DescriptorType(IntEnum):
              NONE = 0
              SAMPLER = vk.VK_DESCRIPTOR_TYPE_SAMPLER
              COMBINED_IMAGE_SAMPLER = vk.VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER
              SAMPLED_IMAGE = vk.VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE
          Severity: Major
          Found in vulk/vulkanconstant.py and 1 other location - About 5 hrs to fix
          vulk/vulkanconstant.py on lines 601..613

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 86.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          class PrimitiveTopology(IntEnum):
              NONE = 0
              POINT_LIST = vk.VK_PRIMITIVE_TOPOLOGY_POINT_LIST
              LINE_LIST = vk.VK_PRIMITIVE_TOPOLOGY_LINE_LIST
              LINE_STRIP = vk.VK_PRIMITIVE_TOPOLOGY_LINE_STRIP
          Severity: Major
          Found in vulk/vulkanconstant.py and 1 other location - About 5 hrs to fix
          vulk/vulkanconstant.py on lines 212..224

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 86.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          class ShaderStage(IntFlag):
              NONE = 0
              VERTEX = vk.VK_SHADER_STAGE_VERTEX_BIT
              TESSELLATION_CONTROL = vk.VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT
              TESSELLATION_EVALUATION = vk.VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT # noqa
          Severity: Major
          Found in vulk/vulkanconstant.py and 2 other locations - About 3 hrs to fix
          vulk/vulkanconstant.py on lines 155..164
          vulk/vulkanconstant.py on lines 509..518

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 65.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          class CompareOp(IntEnum):
              NONE = 0
              NEVER = vk.VK_COMPARE_OP_NEVER
              LESS = vk.VK_COMPARE_OP_LESS
              EQUAL = vk.VK_COMPARE_OP_EQUAL
          Severity: Major
          Found in vulk/vulkanconstant.py and 2 other locations - About 3 hrs to fix
          vulk/vulkanconstant.py on lines 509..518
          vulk/vulkanconstant.py on lines 642..651

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 65.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          class ImageUsage(IntFlag):
              NONE = 0
              TRANSFER_SRC = vk.VK_IMAGE_USAGE_TRANSFER_SRC_BIT
              TRANSFER_DST = vk.VK_IMAGE_USAGE_TRANSFER_DST_BIT
              SAMPLED = vk.VK_IMAGE_USAGE_SAMPLED_BIT
          Severity: Major
          Found in vulk/vulkanconstant.py and 2 other locations - About 3 hrs to fix
          vulk/vulkanconstant.py on lines 155..164
          vulk/vulkanconstant.py on lines 642..651

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 65.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def __init__(self, path):
                  '''Load the sound file
          
                  *Parameters:*
          
          
          Severity: Major
          Found in vulk/audio.py and 1 other location - About 3 hrs to fix
          vulk/audio.py on lines 109..121

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 65.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              def __init__(self, path):
                  '''Load the music file
          
                  *Parameters:*
          
          
          Severity: Major
          Found in vulk/audio.py and 1 other location - About 3 hrs to fix
          vulk/audio.py on lines 60..72

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 65.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Cyclomatic complexity is too high in method __init__. (14)
          Open

              def __init__(self, context, attachments, subpasses, dependencies):
                  """Renderpass constructor
          
                  Args:
                      context (VulkContext)
          Severity: Minor
          Found in vulk/vulkanobject.py by radon

          Cyclomatic Complexity

          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

          Construct Effect on CC Reasoning
          if +1 An if statement is a single decision.
          elif +1 The elif statement adds another decision.
          else +0 The else statement does not cause a new decision. The decision is at the if.
          for +1 There is a decision at the start of the loop.
          while +1 There is a decision at the while statement.
          except +1 Each except branch adds a new conditional path of execution.
          finally +0 The finally block is unconditionally executed.
          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
          assert +1 The assert statement internally roughly equals a conditional statement.
          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

          Source: http://radon.readthedocs.org/en/latest/intro.html

          Severity
          Category
          Status
          Source
          Language