tobspr/RenderPipeline

View on GitHub

Showing 873 of 873 total issues

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

    def reload_shaders(self):
        self.target.shader = self.load_plugin_shader("fxaa_stage.frag.glsl")
        self.luma_target.shader = self.load_plugin_shader("write_luma.frag.glsl")
Severity: Major
Found in rpplugins/fxaa/fxaa_stage.py and 3 other locations - About 50 mins to fix
rpcore/stages/final_stage.py on lines 60..62
rpplugins/pssm/pssm_stage.py on lines 63..65
rpplugins/sky_ao/ao_stage.py on lines 58..61

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

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

    def parse_flow_sequence_entry_mapping_end(self):
        self.state = self.parse_flow_sequence_entry
        token = self.peek_token()
        return MappingEndEvent(token.start_mark, token.start_mark)
Severity: Minor
Found in rplibs/yaml/yaml_py2/parser.py and 1 other location - About 50 mins to fix
rplibs/yaml/yaml_py3/parser.py on lines 526..529

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

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

    def check_node(self):
        # Drop the STREAM-START event.
        if self.check_event(StreamStartEvent):
            self.get_event()

Severity: Minor
Found in rplibs/yaml/yaml_py2/composer.py and 1 other location - About 50 mins to fix
rplibs/yaml/yaml_py3/composer.py on lines 16..22

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

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 push_mat4(self, value):
        for i in range(4):
            for j in range(4):
                self.push_float(value.get_cell(i, j))
Severity: Minor
Found in rpcore/pynative/gpu_command.py and 1 other location - About 50 mins to fix
rpplugins/env_probes/environment_probe.py on lines 117..119

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

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

        for i in range(4):
            for j in range(3):
                data.append(mat.get_cell(i, j))
Severity: Minor
Found in rpplugins/env_probes/environment_probe.py and 1 other location - About 50 mins to fix
rpcore/pynative/gpu_command.py on lines 69..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 36.

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

        if self.is_plugin_enabled("pssm"):
            self.capture_stage.required_pipes += ["PSSMSceneSunShadowMapPCF"]
            self.capture_stage.required_inputs += ["PSSMSceneSunShadowMVP"]
Severity: Major
Found in rpplugins/env_probes/plugin.py and 2 other locations - About 50 mins to fix
rpplugins/forward_shading/plugin.py on lines 46..48
rpplugins/forward_shading/plugin.py on lines 50..52

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

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

        if u'.' in name:
            module_name, object_name = name.rsplit('.', 1)
        else:
            module_name = '__builtin__'
            object_name = name
Severity: Minor
Found in rplibs/yaml/yaml_py2/constructor.py and 1 other location - About 50 mins to fix
rplibs/yaml/yaml_py3/constructor.py on lines 515..519

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

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

        if self.is_plugin_enabled("pssm"):
            self.stage.required_pipes += ["PSSMSceneSunShadowMapPCF"]
            self.stage.required_inputs += ["PSSMSceneSunShadowMVP"]
Severity: Major
Found in rpplugins/forward_shading/plugin.py and 2 other locations - About 50 mins to fix
rpplugins/env_probes/plugin.py on lines 75..77
rpplugins/forward_shading/plugin.py on lines 50..52

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

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

        if self.is_plugin_enabled("env_probes"):
            self.stage.required_pipes += ["PerCellProbes"]
            self.stage.required_inputs += ["EnvProbes"]
Severity: Major
Found in rpplugins/forward_shading/plugin.py and 2 other locations - About 50 mins to fix
rpplugins/env_probes/plugin.py on lines 75..77
rpplugins/forward_shading/plugin.py on lines 46..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 36.

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

        if '.' in name:
            module_name, object_name = name.rsplit('.', 1)
        else:
            module_name = 'builtins'
            object_name = name
Severity: Minor
Found in rplibs/yaml/yaml_py3/constructor.py and 1 other location - About 50 mins to fix
rplibs/yaml/yaml_py2/constructor.py on lines 499..503

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

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 stage_information has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def stage_information(self):
        """ Returns the amount of attached stages, and also the memory consumed
        in MiB in a tuple. """
        count, memory = 0, 0
        for entry in self.entries:
Severity: Minor
Found in rpcore/gui/buffer_viewer.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

Avoid deeply nested control flow statements.
Open

                        for line_to_insert in insertions:
                            if line_to_insert is None:
                                self.warn("Empty insertion '" + hook_name + "'")
                                continue

Severity: Major
Found in rpcore/effect.py - About 45 mins to fix

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

        def apply_state(self, container_name, np, shader, name, sort):
    Severity: Minor
    Found in rpcore/pynative/tag_state_manager.py - About 45 mins to fix

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

          def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,
      Severity: Minor
      Found in rplibs/yaml/yaml_py3/events.py - About 45 mins to fix

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

            def __init__(self, token_number, required, index, line, column, mark):
        Severity: Minor
        Found in rplibs/yaml/yaml_py3/scanner.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if not tristrips_warning_emitted:
                                      self.warn("At least one GeomNode (", geom_node.get_name(), "and possible more..) contains tristrips.")
                                      self.warn("Due to a NVIDIA Driver bug, we have to convert them to triangles now.")
                                      self.warn("Consider exporting your models with the Bam Exporter to avoid this.")
                                      tristrips_warning_emitted = True
          Severity: Major
          Found in rpcore/render_pipeline.py - About 45 mins to fix

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

                def save_overrides(self, override_file):
                    """ Saves all overrides to the given file """
                    output = "\n# Render Pipeline Plugin Configuration\n"
                    output += "# Instead of editing this file, prefer to use the Plugin Configurator\n"
                    output += "# Any formatting and comments will be lost\n\n"
            Severity: Minor
            Found in rpcore/pluginbase/manager.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, stream, canonical=None, indent=None, width=None,
            Severity: Minor
            Found in rplibs/yaml/yaml_py3/emitter.py - About 45 mins to fix

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

                  def _bind_inputs_to_stage(self, stage):
                      """ Binds all inputs including common inputs to the given stage """
                      common_inputs = ["mainCam", "mainRender", "MainSceneData", "TimeOfDay"]
                      for input_binding in stage.required_inputs + common_inputs:
                          if input_binding not in self.inputs and \
              Severity: Minor
              Found in rpcore/stage_manager.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

              Avoid deeply nested control flow statements.
              Open

                                      if in_main:
                                          addline(indent + "}")
              
              
              Severity: Major
              Found in rpcore/effect.py - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language