lighttroupe/luz

View on GitHub

Showing 90 of 250 total issues

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

class UserObjectSettingTheme < UserObjectSetting
    attr_accessor :theme

    def to_yaml_properties
        super + ['@theme']
Severity: Minor
Found in engine/user_object_settings/user_object_setting_theme.rb and 1 other location - About 25 mins to fix
engine/user_object_settings/user_object_setting_curve.rb on lines 3..20

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

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

class UserObjectSettingCurve < UserObjectSetting
    attr_accessor :curve

    def to_yaml_properties
        super + ['@curve']
Severity: Minor
Found in engine/user_object_settings/user_object_setting_curve.rb and 1 other location - About 25 mins to fix
engine/user_object_settings/user_object_setting_theme.rb on lines 3..20

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

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

        box << edit_button=GuiButton.new.set(:float => :left, :scale_x => 0.07, :scale_y => 0.70, :offset_x => 0.01, :offset_y => -0.3, :background_image => $engine.load_image('images/buttons/edit-actor.png'), :background_image_hover => $engine.load_image('images/buttons/edit-actor-hover.png'), :background_image_click => $engine.load_image('images/buttons/edit-actor-click.png'))
Severity: Minor
Found in gui/addons/user_object_setting_actor.rb and 1 other location - About 25 mins to fix
gui/addons/user_object_setting_actor.rb on lines 24..24

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

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

        box << clear_button=GuiButton.new.set(:float => :left, :scale_x => 0.07, :scale_y => 0.7, :offset_x => 0.02, :offset_y => -0.3, :background_image => $engine.load_image('images/buttons/clear.png'), :background_image_hover => $engine.load_image('images/buttons/clear-hover.png'), :background_image_click => $engine.load_image('images/buttons/clear-click.png'))
Severity: Minor
Found in gui/addons/user_object_setting_actor.rb and 1 other location - About 25 mins to fix
gui/addons/user_object_setting_actor.rb on lines 19..19

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

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

        self << (@double_bpm_button = GuiButton.new.set(:scale_x => 1.0, :scale_y => 1.0, :offset_x => 0.0, :offset_y => 0.0, :background_image => $engine.load_image('images/buttons/double.png'), :background_image_hover => $engine.load_image('images/buttons/double-hover.png'), :background_image_click => $engine.load_image('images/buttons/double-click.png')))
Severity: Major
Found in gui/gui_beat_monitor.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

        box << new_button=GuiButton.new.set(:float => :left, :scale_x => 0.10, :scale_y => 0.70, :offset_y => -0.3, :background_image => $engine.load_image('images/buttons/new-actor.png'), :background_image_hover => $engine.load_image('images/buttons/new-actor-hover.png'), :background_image_click => $engine.load_image('images/buttons/new-actor-click.png'))
Severity: Minor
Found in gui/addons/user_object_setting_actor.rb and 1 other location - About 20 mins to fix
gui/addons/user_object_setting_director.rb on lines 6..6

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

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

        self << @project_menu_button = GuiButton.new.set(:scale_x => 0.04, :scale_y => 0.06, :offset_x => -0.48, :offset_y => 0.47, :background_image => $engine.load_image('images/corner.png'), :background_image_hover => $engine.load_image('images/corner-hover.png'), :background_image_click => $engine.load_image('images/corner-click.png'))
Severity: Major
Found in gui/gui_default.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

    def gui_build_editor
        box = GuiBox.new
        box << create_user_object_setting_name_label
        box << GuiFontSelect.new(self, :font).set(:scale_x => 0.5, :offset_x => -0.25, :scale_y => 0.5, :offset_y => 0.25, :item_aspect_ratio => 6.0)
        box
Severity: Minor
Found in gui/addons/user_object_setting_font.rb and 3 other locations - About 20 mins to fix
gui/addons/user_object_setting_curve.rb on lines 2..6
gui/addons/user_object_setting_curve_increasing.rb on lines 2..6
gui/addons/user_object_setting_string.rb on lines 2..6

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

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

        self << @cancel_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => -0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/main-menu-close.png'), :background_image_hover => $engine.load_image('images/buttons/main-menu-close-hover.png'), :background_image_click => $engine.load_image('images/buttons/main-menu-close-click.png'))
Severity: Major
Found in gui/gui_main_menu.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

        self << @cancel_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => 0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/director-view-close.png'), :background_image_hover => $engine.load_image('images/buttons/director-view-close-hover.png'), :background_image_click => $engine.load_image('images/buttons/director-view-close-click.png'))
Severity: Major
Found in gui/gui_director_menu.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

        self << @project_effects_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => 0.475, :offset_y => -0.47, :background_image => $engine.load_image('images/buttons/project-effects.png'), :background_image_hover => $engine.load_image('images/buttons/project-effects-hover.png'), :background_image_click => $engine.load_image('images/buttons/project-effects-click.png'))
Severity: Major
Found in gui/gui_director_menu.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

    def gui_build_editor
        box = GuiBox.new
        box << create_user_object_setting_name_label
        box << GuiCurveIncreasing.new(self, :curve).set(:scale_x => 0.15, :scale_y => 0.4, :float => :left, :offset_x => 0.04, :offset_y => 0.14)
        box
Severity: Minor
Found in gui/addons/user_object_setting_curve_increasing.rb and 3 other locations - About 20 mins to fix
gui/addons/user_object_setting_curve.rb on lines 2..6
gui/addons/user_object_setting_font.rb on lines 2..6
gui/addons/user_object_setting_string.rb on lines 2..6

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

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

    def gui_build_editor
        box = GuiBox.new
        box << create_user_object_setting_name_label
        box << GuiCurve.new(self, :curve).set(:scale_x => 0.15, :scale_y => 0.4, :float => :left, :offset_x => 0.04, :offset_y => 0.14)
        box
Severity: Minor
Found in gui/addons/user_object_setting_curve.rb and 3 other locations - About 20 mins to fix
gui/addons/user_object_setting_curve_increasing.rb on lines 2..6
gui/addons/user_object_setting_font.rb on lines 2..6
gui/addons/user_object_setting_string.rb on lines 2..6

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

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

            i.distributed_among(number, 1.0..smallest) { |amount|
                with_scale(amount) {
                    with_translation(0,0,(i.to_f/number) * height) {
                        yield :child_index => i, :total_children => number
                    }
Severity: Minor
Found in engine/plugins/actor_effects/stack.luz.rb and 1 other location - About 20 mins to fix
engine/plugins/actor_effects/spotlight.luz.rb on lines 19..23

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

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

        self << (@close_button=GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => 0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/file-dialog-cancel.png'), :background_image_hover => $engine.load_image('images/buttons/file-dialog-cancel-hover.png'), :background_image_click => $engine.load_image('images/buttons/file-dialog-cancel-click.png')))
Severity: Major
Found in gui/gui_file_dialog.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

        self << (@close_button=GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => 0.475, :offset_y => 0.47, :background_image => $engine.load_image('images/buttons/file-dialog-cancel.png'), :background_image_hover => $engine.load_image('images/buttons/file-dialog-cancel-hover.png'), :background_image_click => $engine.load_image('images/buttons/file-dialog-cancel-click.png')))
Severity: Major
Found in gui/gui_directory_dialog.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

        self << @quit_button = GuiButton.new.set(:scale_x => 0.05, :scale_y => 0.06, :offset_x => -0.475, :offset_y => -0.47, :background_image => $engine.load_image('images/buttons/main-menu-quit.png'), :background_image_hover => $engine.load_image('images/buttons/main-menu-quit-hover.png'), :background_image_click => $engine.load_image('images/buttons/main-menu-quit-click.png'))
Severity: Major
Found in gui/gui_main_menu.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 253..253
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39

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

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

        self << (@actors_button = GuiButton.new.set(:scale_x => -0.04, :scale_y => -0.06, :offset_x => 0.48, :offset_y => -0.47, :background_image => $engine.load_image('images/corner.png'), :background_image_hover => $engine.load_image('images/corner-hover.png'), :background_image_click => $engine.load_image('images/corner-click.png')))
Severity: Major
Found in gui/gui_default.rb and 13 other locations - About 20 mins to fix
gui/gui_beat_monitor.rb on lines 31..31
gui/gui_beat_monitor.rb on lines 34..34
gui/gui_default.rb on lines 259..259
gui/gui_default.rb on lines 280..280
gui/gui_director_menu.rb on lines 24..24
gui/gui_director_menu.rb on lines 30..30
gui/gui_director_menu.rb on lines 35..35
gui/gui_directory_dialog.rb on lines 22..22
gui/gui_file_dialog.rb on lines 93..93
gui/gui_main_menu.rb on lines 13..13
gui/gui_main_menu.rb on lines 16..16
gui/gui_main_menu.rb on lines 39..39
gui/gui_main_menu.rb on lines 50..50

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

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

    def gui_build_editor
        box = GuiBox.new
        box << create_user_object_setting_name_label
        box << GuiString.new(self, :string).set(:width => 20, :scale_x => 1.0, :float => :left, :scale_y => 0.5, :offset_y => 0.0)
        box
Severity: Minor
Found in gui/addons/user_object_setting_string.rb and 3 other locations - About 20 mins to fix
gui/addons/user_object_setting_curve.rb on lines 2..6
gui/addons/user_object_setting_curve_increasing.rb on lines 2..6
gui/addons/user_object_setting_font.rb on lines 2..6

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

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

        box << clear_button=GuiButton.new.set(:float => :left, :scale_x => 0.05, :scale_y => 0.8, :offset_y => -0.2, :background_image => $engine.load_image('images/buttons/clear.png'), :background_image_hover => $engine.load_image('images/buttons/clear-hover.png'), :background_image_click => $engine.load_image('images/buttons/clear-click.png'))
Severity: Minor
Found in gui/addons/user_object_setting_director.rb and 1 other location - About 20 mins to fix
gui/addons/user_object_setting_actor.rb on lines 12..12

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

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