tobspr/RenderPipeline

View on GitHub

Showing 873 of 873 total issues

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

    def parse_flow_sequence_first_entry(self):
        token = self.get_token()
        self.marks.append(token.start_mark)
        return self.parse_flow_sequence_entry(first=True)
Severity: Major
Found in rplibs/yaml/yaml_py3/parser.py and 3 other locations - About 1 hr to fix
rplibs/yaml/yaml_py2/parser.py on lines 471..474
rplibs/yaml/yaml_py2/parser.py on lines 537..540
rplibs/yaml/yaml_py3/parser.py on lines 537..540

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

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

        self._bright_text = Text(
            text="Bright: 1", parent=self._content_node, x=x_pos, y=72, size=18,
            color=Vec3(0.4, 0.4, 1), may_change=1)
Severity: Major
Found in rpcore/gui/texture_preview.py and 2 other locations - About 1 hr to fix
rpcore/gui/texture_preview.py on lines 111..113
rpcore/gui/texture_preview.py on lines 124..126

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

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

    @property
    def mvp(self):
        return Globals.base.render.get_transform(self.cam_node).get_mat() * \
            self.cam_lens.get_projection_mat()
Severity: Major
Found in rpplugins/pssm/pssm_scene_shadow_stage.py and 1 other location - About 1 hr to fix
rpplugins/pssm/pssm_dist_shadow_stage.py on lines 59..62

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

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

            self._mip_text = Text(
                text="MIP: 5", parent=self._content_node, x=x_pos, y=72, size=18,
                color=Vec3(1, 0.4, 0.4), may_change=1)
Severity: Major
Found in rpcore/gui/texture_preview.py and 2 other locations - About 1 hr to fix
rpcore/gui/texture_preview.py on lines 124..126
rpcore/gui/texture_preview.py on lines 135..137

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

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:
        dumper.open()
        for data in documents:
            dumper.represent(data)
        dumper.close()
Severity: Major
Found in rplibs/yaml/yaml_py2/__init__.py and 1 other location - About 1 hr to fix
rplibs/yaml/yaml_py2/__init__.py on lines 146..152

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

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 set_initial_position_hpr(self, pos, hpr):
        """ Sets the initial camera position """
        self.initial_position = pos
        self.initial_hpr = hpr
        self.use_hpr = True
Severity: Major
Found in rpcore/util/movement_controller.py and 1 other location - About 1 hr to fix
rpcore/util/movement_controller.py on lines 66..71

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

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 add_path_resolver(tag, path, kind=None, Loader=Loader, Dumper=Dumper):
    """
    Add a path based resolver for the given tag.
    A path is a list of keys that forms a path
    to a node in the representation tree.
Severity: Major
Found in rplibs/yaml/yaml_py2/__init__.py and 1 other location - About 1 hr to fix
rplibs/yaml/yaml_py2/__init__.py on lines 220..229

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

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:
            with open("/$$rptemp/$$pipeline_shader_config.inc.glsl", "w") as handle:
                handle.write(output)
        except IOError as msg:
            self.error("Error writing shader autoconfig:", msg)
Severity: Major
Found in rpcore/stage_manager.py and 1 other location - About 1 hr to fix
rpcore/common_resources.py on lines 113..118

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

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:
            # Try to write the temporary file
            with open("/$$rptemp/$$main_scene_data.inc.glsl", "w") as handle:
                handle.write(content)
        except IOError as msg:
Severity: Major
Found in rpcore/common_resources.py and 1 other location - About 1 hr to fix
rpcore/stage_manager.py on lines 282..286

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

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 add_implicit_resolver(tag, regexp, first=None,
        Loader=Loader, Dumper=Dumper):
    """
    Add an implicit scalar detector.
    If an implicit scalar value matches the given regexp,
Severity: Major
Found in rplibs/yaml/yaml_py2/__init__.py and 1 other location - About 1 hr to fix
rplibs/yaml/yaml_py2/__init__.py on lines 231..239

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

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 set_initial_position(self, pos, target):
        """ Sets the initial camera position """
        self.initial_position = pos
        self.initial_destination = target
        self.use_hpr = False
Severity: Major
Found in rpcore/util/movement_controller.py and 1 other location - About 1 hr to fix
rpcore/util/movement_controller.py on lines 73..78

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

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:
        dumper.open()
        for node in nodes:
            dumper.serialize(node)
        dumper.close()
Severity: Major
Found in rplibs/yaml/yaml_py2/__init__.py and 1 other location - About 1 hr to fix
rplibs/yaml/yaml_py2/__init__.py on lines 187..193

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

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 create has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def create(self):
        # Create a target for the specular GI
        # self.target_spec = self.create_target("SpecularGI")
        # self.target_spec.add_color_attachment(bits=16, alpha=True)
        # self.target_spec.prepare_buffer()
Severity: Minor
Found in rpplugins/vxgi/vxgi_stage.py - About 1 hr to fix

    Function present has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def present(self, tex):
            """ "Presents" a given texture and shows the window """
            self._current_tex = tex
    
            self.set_title(tex.get_name())
    Severity: Minor
    Found in rpcore/gui/texture_preview.py - About 1 hr to fix

      Function create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def create(self):
              self.camera = Camera("PSSMDistShadowsESM")
              self.cam_lens = OrthographicLens()
              self.cam_lens.set_film_size(12000, 12000)
              self.cam_lens.set_near_far(10.0, self.sun_distance * 2)
      Severity: Minor
      Found in rpplugins/pssm/pssm_dist_shadow_stage.py - About 1 hr to fix

        Function retranslateUi has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def retranslateUi(self, MainWindow):
                _translate = QtCore.QCoreApplication.translate
                MainWindow.setWindowTitle(_translate("MainWindow", "Day Time Editor"))
                self.lbl_current_setting.setText(_translate("MainWindow", "Occlusion Strength"))
                self.btn_reset.setText(_translate("MainWindow", "Reset curve"))
        Severity: Minor
        Found in toolkit/day_time_editor/ui/main_window_generated.py - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                      if not double and ch == '\'' and self.peek(1) == '\'':
                          chunks.append('\'')
                          self.forward(2)
                      elif (double and ch == '\'') or (not double and ch in '\"\\'):
                          chunks.append(ch)
          Severity: Major
          Found in rplibs/yaml/yaml_py3/scanner.py - About 1 hr to fix

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

                def __init__(self, scalar, empty, multiline,
            Severity: Major
            Found in rplibs/yaml/yaml_py3/emitter.py - About 1 hr to fix

              Function emit has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def emit(events, stream=None, Dumper=Dumper,
              Severity: Major
              Found in rplibs/yaml/yaml_py3/__init__.py - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if not double and ch == u'\'' and self.peek(1) == u'\'':
                                chunks.append(u'\'')
                                self.forward(2)
                            elif (double and ch == u'\'') or (not double and ch in u'\"\\'):
                                chunks.append(ch)
                Severity: Major
                Found in rplibs/yaml/yaml_py2/scanner.py - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language