realitix/vulk

View on GitHub

Showing 152 of 152 total issues

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

    def unproject(self, position, viewport_x, viewport_y,
Severity: Minor
Found in vulk/graphic/camera.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, texture, u=0, v=0, u2=1, v2=1):
        Severity: Minor
        Found in vulk/graphic/texture.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

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

                        return self.value ** power * sin(a) * self.scale / 2
            Severity: Minor
            Found in vulk/math/interpolation.py and 1 other location - About 35 mins to fix
            vulk/math/interpolation.py on lines 136..136

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

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

                    return 1 - self.value ** power * sin(a) * self.scale / 2
            Severity: Minor
            Found in vulk/math/interpolation.py and 1 other location - About 35 mins to fix
            vulk/math/interpolation.py on lines 130..130

            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

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

                def draw(self, texture, x, y, width=0, height=0, u=0, v=0, u2=1, v2=1,
                         r=1, g=1, b=1, a=1, scale_x=1, scale_y=1, rotation=0):
                    '''
                    Draw `texture` at position x, y of size `width`, `height`
            
            
            Severity: Minor
            Found in vulk/graphic/d2/batch.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

            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

            Avoid too many return statements within this function.
            Open

                        return self.mouse_move(event.x, event.y, event.xr, event.yr)
            Severity: Major
            Found in vulk/event.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return False
              Severity: Major
              Found in vulk/event.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return self.mouse_down(event.x, event.y, event.button)
                Severity: Major
                Found in vulk/event.py - About 30 mins to fix

                  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

                  Avoid too many return statements within this function.
                  Open

                              return self.window_resized(event.width, event.height)
                  Severity: Major
                  Found in vulk/event.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return self.quit()
                    Severity: Major
                    Found in vulk/event.py - About 30 mins to fix

                      Function _get_instance_extensions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _get_instance_extensions(self):
                              """Get extensions which depend on the window
                      
                              Returns:
                                  Extensions list (list[str])
                      Severity: Minor
                      Found in vulk/context.py - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language