lighttroupe/luz

View on GitHub

Showing 250 of 250 total issues

Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def initialize(object, method, min, max, digits)
Severity: Minor
Found in gui/gui_float.rb - About 35 mins to fix

    Method RoundedRectangle has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def self.RoundedRectangle(radius_x, radius_y, knob_x, knob_y, detail)
    Severity: Minor
    Found in utils/gl_shapes.rb - About 35 mins to fix

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

          def render
              # spot between 0.0 and eg. 7.0 for 6 actors
              spot = total_children * $env[:exit]
      
              # the active actor
      Severity: Minor
      Found in engine/plugins/actor_effects/child-exit-stagger.luz.rb and 1 other location - About 35 mins to fix
      engine/plugins/actor_effects/child-enter-stagger.luz.rb on lines 9..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

              self.class_eval <<-end_class_eval
                  # How child classes access the (cached) value for this UOS.
                  # This allows them to refer to the value multiple times without calculating the value every time.
                  def #{name}
                      @#{name}_value
      Severity: Minor
      Found in engine/user_object.rb and 1 other location - About 35 mins to fix
      utils/easy_dsl.rb on lines 41..58

      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

                  self.class_eval <<-end_class_eval
                      def self.#{singular}(value)
                          @#{plural} ||= Set.new    # NOTE: singular form adds to set
                          @#{plural} << value
                          @#{plural}
      Severity: Minor
      Found in utils/easy_dsl.rb and 1 other location - About 35 mins to fix
      engine/user_object.rb on lines 43..66

      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

              @enable_enter_toggle.on_clicked_with_init {
                  if @enable_enter_toggle.on?
                      @enter_widgets.each_with_index { |widget, index| widget.animate({:opacity => 1.0}, duration = (0.05 + (index * 0.2))) }
                  else
                      @enter_widgets.each_with_index { |widget, index| widget.animate({:opacity => 0.2}, duration = (0.05 + (index * 0.1))) }
      Severity: Minor
      Found in gui/gui_enter_exit_popup.rb and 1 other location - About 35 mins to fix
      gui/gui_enter_exit_popup.rb on lines 32..36

      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

              @enable_exit_toggle.on_clicked_with_init {
                  if @enable_exit_toggle.on?
                      @exit_widgets.each_with_index { |widget, index| widget.animate({:opacity => 1.0}, duration = (0.05 + (index * 0.2))) }
                  else
                      @exit_widgets.each_with_index { |widget, index| widget.animate({:opacity => 0.2}, duration = (0.05 + (index * 0.1))) }
      Severity: Minor
      Found in gui/gui_enter_exit_popup.rb and 1 other location - About 35 mins to fix
      gui/gui_enter_exit_popup.rb on lines 18..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 render
              # spot between 0.0 and eg. 7.0 for 6 actors
              spot = total_children * $env[:enter]
      
              # the active actor
      Severity: Minor
      Found in engine/plugins/actor_effects/child-enter-stagger.luz.rb and 1 other location - About 35 mins to fix
      engine/plugins/actor_effects/child-exit-stagger.luz.rb on lines 9..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

      Method with_enter_exit_progress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def with_enter_exit_progress(value)
              with_env(:enter, (value < 0.5) ? (value / 0.5) : 1.0) {
                  with_env(:exit, (value > 0.5) ? ((value - 0.5) / 0.5) : 0.0) {
                      yield
                  }
      Severity: Minor
      Found in engine/engine/engine_methods_for_user_object.rb - 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

      Method value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def value
              now = Time.now.to_f
              if @on_until && now < @on_until
                  true
              else
      Severity: Minor
      Found in engine/plugins/event_inputs/slider-active.luz.rb - 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

      Method pipe has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def pipe(signal, target, original_options={})
              (signal.respond_to?(:each) ? signal : [signal]).each { |signal|
                  options = {:method => signal}.merge(original_options)
                  if options[:args]
                      module_eval( "def #{signal}(&proc) instance_variable_get('@' + '#{target.to_s}').send('#{options[:method]}', #{options[:args]}, &proc) ; end", "__(METHOD PIPING)__", 1)
      Severity: Minor
      Found in utils/method_piping.rb - 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

      Method gui_render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def gui_render
              with_gui_object_properties {
                  object = get_value
                  if object
                      @current_value_renderer = object.new_renderer if @current_value_renderer.nil? || @current_value_renderer.object != object
      Severity: Minor
      Found in gui/gui_list_select.rb - 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

      Method progress_since has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def progress_since(time, beat=nil)
              return 1.0 if instant?
      
              if @time_unit == :beats
                  return 0.0 if beat.nil?
      Severity: Minor
      Found in engine/user_object_settings/user_object_setting_timespan.rb - 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

      Method reload_if_newer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def reload_if_newer(filepath)
              file = File.new(filepath) rescue nil
              return false unless file        # no longer exists?
      
              mtime = file.mtime
      Severity: Minor
      Found in utils/reloadable_require.rb - 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

      Method to_zaml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_zaml(z)
              z.first_time_only(self) {
                  num = '[-+]?(0x)?\d+\.?\d*'
                  case
                    when self == ''
      Severity: Minor
      Found in utils/zaml.rb - 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

      Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def update(max_packets=nil)
              begin
                  loop {
                      # check readability of socket to avoid generating unnecessary Errno::EAGAIN exceptions
                      return if IO.select(@socket_array, nil, nil, 0).nil?
      Severity: Minor
      Found in utils/osc_server.rb - 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

      Method value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def value
              @velocity ||= 0.0
      
              # add to velocity
              if slider > 0.0 and slider_setting.last_value == 0.0
      Severity: Minor
      Found in engine/plugins/variable_inputs/slider-impulse.luz.rb - 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

      Method delta_min_max_avg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def delta_min_max_avg
              min, max, total = nil, nil, 0.0
      
              for i in 0..size-2
                  difference = self[i + 1] - self[i]
      Severity: Minor
      Found in utils/addons/array.rb - 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

      Method with_frame has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def with_frame(index=0)
                  @image ||= Image.new
                  @index ||= 0
      
                  # loop index around on both sides
      Severity: Minor
      Found in utils/video_file/ffmpeg.rb - 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

          def render
              # Right
              with_clip_plane([ -1.0, 0.0, 0.0, 0.0]) {
                  yield :child_index => 0, :total_children => 2
              }
      Severity: Minor
      Found in engine/plugins/actor_effects/mirror-horizontal.luz.rb and 1 other location - About 30 mins to fix
      engine/plugins/actor_effects/mirror-vertical.luz.rb on lines 7..17

      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

      Severity
      Category
      Status
      Source
      Language