realitix/vulk

View on GitHub
vulk/vulkanobject.py

Summary

Maintainability
F
1 wk
Test Coverage

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

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

        def __init__(self, context, stages, vertex_input, input_assembly,
                     viewport_state, rasterization, multisample, depth, blend,
                     dynamic, layout, renderpass):
            """
            Args:
    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

    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

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

        def __init__(self, float32=None, uint32=None, int32=None):
            '''
            Take only one value depending on the type you want.
            `list` must be of size 4.
    
    
    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

    Cyclomatic complexity is too high in class ClearColorValue. (12)
    Open

    class ClearColorValue():
        '''ClearValue for color clearing'''
    
        def __init__(self, float32=None, uint32=None, int32=None):
            '''
    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

    Cyclomatic complexity is too high in function submit_to_queue. (9)
    Open

    def submit_to_queue(queue, submits):
        '''
        Submit commands to queue
    
        *Parameters:*
    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

    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

      Cyclomatic complexity is too high in method _copy_staging_to_final. (7)
      Open

          def _copy_staging_to_final(self, context):
              """Prepare and copy staging buffer to final image
      
              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

      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 __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 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 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

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

                def __init__(self, context, stages, vertex_input, input_assembly,
                             viewport_state, rasterization, multisample, depth, blend,
                             dynamic, layout, renderpass):
                    """
                    Args:
            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 update_layout has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def update_layout(self, cmd, old_layout, new_layout, src_stage,
            Severity: Major
            Found in vulk/vulkanobject.py - About 1 hr to fix

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

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

                Function __init__ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def __init__(self, context, stages, vertex_input, input_assembly,
                                 viewport_state, rasterization, multisample, depth, blend,
                                 dynamic, layout, renderpass):
                        """
                        Args:
                Severity: Minor
                Found in vulk/vulkanobject.py - About 1 hr to fix

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

                      def __init__(self, context, flags, size, usage, sharing_mode,
                  Severity: Major
                  Found in vulk/vulkanobject.py - About 50 mins to fix

                    Function pipeline_barrier has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def pipeline_barrier(self, src_stage, dst_stage, dependency, memories,
                    Severity: Minor
                    Found in vulk/vulkanobject.py - About 45 mins to fix

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

                          def __init__(self, context, renderpass, attachments,
                      Severity: Minor
                      Found in vulk/vulkanobject.py - About 45 mins to fix

                        Function _init_buffers has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def _init_buffers(self, context, width, height, image_format,
                        Severity: Minor
                        Found in vulk/vulkanobject.py - About 45 mins to fix

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

                              def __init__(self, float32=None, uint32=None, int32=None):
                                  '''
                                  Take only one value depending on the type you want.
                                  `list` must be of size 4.
                          
                          
                          Severity: Minor
                          Found in vulk/vulkanobject.py - About 45 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

                          Function begin has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def begin(self, cmd, framebuffer, renderarea, clears,
                          Severity: Minor
                          Found in vulk/vulkanobject.py - About 35 mins to fix

                            Function bind_descriptor_sets has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def bind_descriptor_sets(self, layout, first, descriptors, offsets,
                            Severity: Minor
                            Found in vulk/vulkanobject.py - About 35 mins to fix

                              Function begin_renderpass has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def begin_renderpass(self, renderpass, framebuffer, renderarea,
                              Severity: Minor
                              Found in vulk/vulkanobject.py - About 35 mins to fix

                                Function draw_indexed has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def draw_indexed(self, index_count, first_index, vertex_offset=0,
                                Severity: Minor
                                Found in vulk/vulkanobject.py - About 35 mins to fix

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

                                      def __init__(self, context, size, usage,
                                  Severity: Minor
                                  Found in vulk/vulkanobject.py - About 35 mins to fix

                                    Function copy_image has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def copy_image(self, src_image, src_layout, dst_image,
                                    Severity: Minor
                                    Found in vulk/vulkanobject.py - About 35 mins to fix

                                      Function submit_to_queue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def submit_to_queue(queue, submits):
                                          '''
                                          Submit commands to queue
                                      
                                          *Parameters:*
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py - 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

                                      TODO found
                                      Open

                                                  # TODO: I don't know exactly how VMA works but I need that flag
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py by fixme

                                      TODO found
                                      Open

                                              TODO: Delete this method
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py by fixme

                                      TODO found
                                      Open

                                              # TODO: VMA bug, I should not have to use dedicated memory
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py by fixme

                                      TODO found
                                      Open

                                              # TODO: To try, not sure it works
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py by fixme

                                      TODO found
                                      Open

                                          # TODO: copies must be implemented
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py by fixme

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

                                              if not self.copied:
                                                  with immediate_buffer(context, commandpool) as cmd:
                                                      self.final_image.update_layout(
                                                          cmd, vc.ImageLayout.PREINITIALIZED,
                                                          vc.ImageLayout.TRANSFER_DST_OPTIMAL,
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 2 other locations - About 2 hrs to fix
                                      vulk/vulkanobject.py on lines 1579..1587
                                      vulk/vulkanobject.py on lines 1608..1616

                                      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 58.

                                      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

                                                  with immediate_buffer(context, commandpool) as cmd:
                                                      self.final_image.update_layout(
                                                          cmd, vc.ImageLayout.PREINITIALIZED,
                                                          vc.ImageLayout.TRANSFER_DST_OPTIMAL,
                                                          vc.PipelineStage.HOST,
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 2 other locations - About 2 hrs to fix
                                      vulk/vulkanobject.py on lines 1578..1599
                                      vulk/vulkanobject.py on lines 1608..1616

                                      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 58.

                                      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

                                              with immediate_buffer(context, commandpool) as cmd:
                                                  self.final_image.update_layout(
                                                      cmd, vc.ImageLayout.TRANSFER_DST_OPTIMAL,
                                                      vc.ImageLayout.SHADER_READ_ONLY_OPTIMAL,
                                                      vc.PipelineStage.TRANSFER,
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 2 other locations - About 2 hrs to fix
                                      vulk/vulkanobject.py on lines 1579..1587
                                      vulk/vulkanobject.py on lines 1578..1599

                                      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 58.

                                      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

                                              vk_renderarea = vk.VkRect2D(
                                                  offset=vk.VkOffset2D(
                                                      x=renderarea.offset.x,
                                                      y=renderarea.offset.y),
                                                  extent=vk.VkExtent2D(
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 1 other location - About 2 hrs to fix
                                      vulk/vulkanobject.py on lines 2007..2010

                                      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 50.

                                      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

                                                  vk_scissors.append(vk.VkRect2D(
                                                      offset=vk.VkOffset2D(x=s.offset.x, y=s.offset.y),
                                                      extent=vk.VkExtent2D(width=s.extent.width,
                                                                           height=s.extent.height),
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 1 other location - About 2 hrs to fix
                                      vulk/vulkanobject.py on lines 883..889

                                      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 50.

                                      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

                                              try:
                                                  data = vma.vmaMapMemory(context.vma_allocator, self.allocation)
                                                  yield data
                                              finally:
                                                  vma.vmaUnmapMemory(context.vma_allocator, self.allocation)
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 1 other location - About 1 hr to fix
                                      vulk/vulkanobject.py on lines 1835..1839

                                      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 38.

                                      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

                                              try:
                                                  data = vma.vmaMapMemory(context.vma_allocator, self.allocation)
                                                  yield data
                                              finally:
                                                  vk.vmaUnmapMemory(context.vma_allocator, self.allocation)
                                      Severity: Major
                                      Found in vulk/vulkanobject.py and 1 other location - About 1 hr to fix
                                      vulk/vulkanobject.py on lines 728..732

                                      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 38.

                                      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

                                              vk_subresource_range = vk.VkImageSubresourceRange(
                                                  aspectMask=subresource_range.aspect.value,
                                                  baseMipLevel=subresource_range.base_miplevel,
                                                  levelCount=subresource_range.level_count,
                                                  baseArrayLayer=subresource_range.base_layer,
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py and 1 other location - About 35 mins to fix
                                      vulk/vulkanobject.py on lines 991..996

                                      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 33.

                                      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

                                                  vk_ranges.append(vk.VkImageSubresourceRange(
                                                      aspectMask=r.aspect.value,
                                                      baseMipLevel=r.base_miplevel,
                                                      levelCount=r.level_count,
                                                      baseArrayLayer=r.base_layer,
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py and 1 other location - About 35 mins to fix
                                      vulk/vulkanobject.py on lines 1886..1891

                                      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 33.

                                      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

                                          def destroy(self, context):
                                              """Destroy this pipeline
                                      
                                              Args:
                                                  context (VulkContext)
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py and 2 other locations - About 30 mins to fix
                                      vulk/vulkanobject.py on lines 1388..1395
                                      vulk/vulkanobject.py on lines 2326..2333

                                      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 32.

                                      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

                                          def destroy(self, context):
                                              """Destroy this framebuffer
                                      
                                              Args:
                                                  context (VulkContext)
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py and 2 other locations - About 30 mins to fix
                                      vulk/vulkanobject.py on lines 2136..2143
                                      vulk/vulkanobject.py on lines 2326..2333

                                      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 32.

                                      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

                                          def destroy(self, context):
                                              """Destroy this renderpass
                                      
                                              Args:
                                                  context (VulkContext)
                                      Severity: Minor
                                      Found in vulk/vulkanobject.py and 2 other locations - About 30 mins to fix
                                      vulk/vulkanobject.py on lines 1388..1395
                                      vulk/vulkanobject.py on lines 2136..2143

                                      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 32.

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status