tobspr/RenderPipeline

View on GitHub

Showing 873 of 873 total issues

Function setup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def setup(self):
        """ Attaches the movement controller and inits the keybindings """
        # x
        self.showbase.accept("raw-w", self.set_movement, [0, 1])
        self.showbase.accept("raw-w-up", self.set_movement, [0, 0])
Severity: Minor
Found in rpcore/util/movement_controller.py - About 1 hr to fix

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

        def __init__(self):
    
            load_prc_file_data("", """
                textures-power-2 none
                win-size 1600 900
    Severity: Minor
    Found in toolkit/bake_gi/display.py - About 1 hr to fix

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

          def compose_document(self):
              # Drop the DOCUMENT-START event.
              self.get_event()
      
              # Compose the root node.
      Severity: Major
      Found in rplibs/yaml/yaml_py2/composer.py and 1 other location - About 1 hr to fix
      rplibs/yaml/yaml_py3/composer.py on lines 50..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 42.

      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 compose_document(self):
              # Drop the DOCUMENT-START event.
              self.get_event()
      
              # Compose the root node.
      Severity: Major
      Found in rplibs/yaml/yaml_py3/composer.py and 1 other location - About 1 hr to fix
      rplibs/yaml/yaml_py2/composer.py on lines 50..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 42.

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

          def _load_and_parse_file(self, pth):
              """ Loads a .IES file from a given filename, returns an IESDataset
              which is used by the load function later on. """
              self.debug("Loading ies profile from", pth)
      
      
      Severity: Minor
      Found in rpcore/util/ies_profile_loader.py - About 1 hr to fix

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

            def _internal_set_effect(self, nodepath, effect_src, options=None, sort=30):
                """ Sets an effect to the given object, using the specified options.
                Check out the effect documentation for more information about possible
                options and configurations. The object should be a nodepath, and the
                effect will be applied to that nodepath and all nodepaths below whose
        Severity: Minor
        Found in rpcore/render_pipeline.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 _perform_update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def _perform_update(self):
                """ Collects all entries, extracts their images and re-renders the
                window """
        
                # Collect texture stages
        Severity: Minor
        Found in rpcore/gui/buffer_viewer.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 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, x=0, y=0, parent=None, size=100, min_value=0,
        Severity: Major
        Found in rpcore/gui/slider.py - About 1 hr to fix

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

              def check_event(self, *choices):
                  # Check the type of the next event.
                  if self.current_event is None:
                      if self.state:
                          self.current_event = self.state()
          Severity: Minor
          Found in rplibs/yaml/yaml_py3/parser.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 _extract_keywords has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def _extract_keywords(self, lines):
                  """ Extracts the keywords from a list of lines, and removes all lines
                  containing keywords """
                  keywords = {}
                  while lines:
          Severity: Minor
          Found in rpcore/util/ies_profile_loader.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 _register_stage_result has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def _register_stage_result(self, stage):
                  """ Registers all produced pipes, inputs and defines from the given
                  stage, so they can be used by later stages. """
                  for pipe_name, pipe_data in (iteritems)(stage.produced_pipes):
                      if isinstance(pipe_data, (SimpleInputBlock, GroupedInputBlock)):
          Severity: Minor
          Found in rpcore/stage_manager.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 check_event has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def check_event(self, *choices):
                  # Check the type of the next event.
                  if self.current_event is None:
                      if self.state:
                          self.current_event = self.state()
          Severity: Minor
          Found in rplibs/yaml/yaml_py2/parser.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 expect_flow_mapping_key has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def expect_flow_mapping_key(self):
                  if isinstance(self.event, MappingEndEvent):
                      self.indent = self.indents.pop()
                      self.flow_level -= 1
                      if self.canonical:
          Severity: Minor
          Found in rplibs/yaml/yaml_py3/emitter.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 expect_flow_mapping_key has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def expect_flow_mapping_key(self):
                  if isinstance(self.event, MappingEndEvent):
                      self.indent = self.indents.pop()
                      self.flow_level -= 1
                      if self.canonical:
          Severity: Minor
          Found in rplibs/yaml/yaml_py2/emitter.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 on_pre_render_update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_pre_render_update(self):
                  sun_vector = self.get_plugin_instance("scattering").sun_vector
          
                  if sun_vector.z < 0.0:
                      self.shadow_stage.active = False
          Severity: Minor
          Found in rpplugins/pssm/plugin.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

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

                              for br in text[start:end]:
                                  if br == u'\n':
                                      self.write_line_break()
                                  else:
                                      self.write_line_break(br)
          Severity: Major
          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
          rplibs/yaml/yaml_py2/emitter.py on lines 1013..1017
          rplibs/yaml/yaml_py2/emitter.py on lines 1061..1065
          rplibs/yaml/yaml_py2/emitter.py on lines 1119..1123

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

          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 4 locations. Consider refactoring.
          Open

                              for br in text[start:end]:
                                  if br == u'\n':
                                      self.write_line_break()
                                  else:
                                      self.write_line_break(br)
          Severity: Major
          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
          rplibs/yaml/yaml_py2/emitter.py on lines 881..885
          rplibs/yaml/yaml_py2/emitter.py on lines 1013..1017
          rplibs/yaml/yaml_py2/emitter.py on lines 1061..1065

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

          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 4 locations. Consider refactoring.
          Open

                              for br in text[start:end]:
                                  if br == u'\n':
                                      self.write_line_break()
                                  else:
                                      self.write_line_break(br)
          Severity: Major
          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
          rplibs/yaml/yaml_py2/emitter.py on lines 881..885
          rplibs/yaml/yaml_py2/emitter.py on lines 1061..1065
          rplibs/yaml/yaml_py2/emitter.py on lines 1119..1123

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

          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 4 locations. Consider refactoring.
          Open

                              for br in text[start:end]:
                                  if br == u'\n':
                                      self.write_line_break()
                                  else:
                                      self.write_line_break(br)
          Severity: Major
          Found in rplibs/yaml/yaml_py2/emitter.py and 3 other locations - About 1 hr to fix
          rplibs/yaml/yaml_py2/emitter.py on lines 881..885
          rplibs/yaml/yaml_py2/emitter.py on lines 1013..1017
          rplibs/yaml/yaml_py2/emitter.py on lines 1119..1123

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

          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

              if stream is None:
                  if encoding is None:
                      from StringIO import StringIO
                  else:
                      from cStringIO import StringIO
          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 135..141

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

          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

          Severity
          Category
          Status
          Source
          Language