opal/corelib/runtime.js

Summary

Maintainability
F
6 days
Test Coverage

File runtime.js has 2000 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

(function(global_object) {
  "use strict";

  // @note
  //   A few conventions for the documentation of this file:
Severity: Major
Found in opal/corelib/runtime.js - About 3 days to fix

    Function $allocate_class has 54 lines of code (exceeds 30 allowed). Consider refactoring.
    Open

      function $allocate_class(name, superclass, singleton) {
        var klass, bridged_descendant;
    
        if (bridged_descendant = descends_from_bridged_class(superclass)) {
          // Inheritance from bridged classes requires
    Severity: Major
    Found in opal/corelib/runtime.js - About 1 hr to fix

      Function prepend_features has 47 lines of code (exceeds 30 allowed). Consider refactoring.
      Invalid

        Opal.prepend_features = function(module, prepender) {
          // Here we change the ancestors chain from
          //
          //   prepender
          //      |
      Severity: Minor
      Found in opal/corelib/runtime.js - About 1 hr to fix

        Function hash has 44 lines of code (exceeds 30 allowed). Consider refactoring.
        Open

          Opal.hash = function () {
            var arguments_length = arguments.length,
              args,
              hash,
              i,
        Severity: Minor
        Found in opal/corelib/runtime.js - About 1 hr to fix

          Function klass has 42 lines of code (exceeds 30 allowed). Consider refactoring.
          Wontfix

            Opal.klass = function(scope, superclass, name) {
              var bridged;
          
              if (scope == null || scope == '::') {
                // Global scope
          Severity: Minor
          Found in opal/corelib/runtime.js - About 1 hr to fix

            Function append_features has 42 lines of code (exceeds 30 allowed). Consider refactoring.
            Wontfix

              Opal.append_features = function(module, includer) {
                var module_ancestors = $ancestors(module);
                var iclasses = [];
            
                if (module_ancestors.indexOf(includer) !== -1) {
            Severity: Minor
            Found in opal/corelib/runtime.js - About 1 hr to fix

              Function alias has 31 lines of code (exceeds 30 allowed). Consider refactoring.
              Open

                Opal.alias = function(obj, name, old) {
                  var id     = $jsid(name),
                      old_id = $jsid(old),
                      body,
                      alias;
              Severity: Minor
              Found in opal/corelib/runtime.js - About 1 hr to fix

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

                  Opal.refined_send = function(refinement_groups, recv, method, args, block, blockopts) {
                Severity: Minor
                Found in opal/corelib/runtime.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Wontfix

                              if (objects.length === 0)
                                hash.$$keys.delete(key_hash);
                  Severity: Major
                  Found in opal/corelib/runtime.js - About 45 mins to fix

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

                      Opal.send2 = function(recv, body, method, args, block, blockopts) {
                    Severity: Minor
                    Found in opal/corelib/runtime.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Wontfix

                                  if (subclass.deref() !== undefined) {
                                    rebuilt_subclasses.push(subclass);
                                  }
                      Severity: Major
                      Found in opal/corelib/runtime.js - About 45 mins to fix

                        Function send has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Wontfix

                          Opal.send = function(recv, method, args, block, blockopts) {
                        Severity: Minor
                        Found in opal/corelib/runtime.js - About 35 mins to fix

                          Function find_super has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            Opal.find_super = function(obj, mid, current_func, defcheck, allow_stubs) {
                          Severity: Minor
                          Found in opal/corelib/runtime.js - About 35 mins to fix

                            Function find_block_super has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              Opal.find_block_super = function(obj, jsid, current_func, defcheck, implicit) {
                            Severity: Minor
                            Found in opal/corelib/runtime.js - About 35 mins to fix

                              Avoid too many return statements within this function.
                              Wontfix

                                  return Opal.send(object, method, args);
                              Severity: Major
                              Found in opal/corelib/runtime.js - About 30 mins to fix

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

                                    if (value.$$is_array) {
                                      return value;
                                    }
                                    else if (value['$respond_to?']('to_ary', true)) {
                                      var ary = value.$to_ary();
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 4 hrs to fix
                                opal/corelib/runtime.js on lines 1823..1842

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

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

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

                                    if (value.$$is_array) {
                                      // A splatted array must be copied
                                      return value.slice();
                                    }
                                    else if (value['$respond_to?']('to_a', true)) {
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 4 hrs to fix
                                opal/corelib/runtime.js on lines 1800..1818

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

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

                                    if (obj.$$is_singleton) {
                                      if (obj.$$prototype.$singleton_method_undefined && !obj.$$prototype.$singleton_method_undefined.$$stub) {
                                        obj.$$prototype.$singleton_method_undefined(jsid.substr(1));
                                      }
                                    }
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 4 hrs to fix
                                opal/corelib/runtime.js on lines 2130..2139

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

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

                                    if (obj.$$is_singleton) {
                                      if (obj.$$prototype.$singleton_method_removed && !obj.$$prototype.$singleton_method_removed.$$stub) {
                                        obj.$$prototype.$singleton_method_removed(jsid.substr(1));
                                      }
                                    }
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 4 hrs to fix
                                opal/corelib/runtime.js on lines 2152..2161

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

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

                                    for (var i = 0, length = module_ancestors.length; i < length; i++) {
                                      var ancestor = module_ancestors[i], iclass = create_iclass(ancestor);
                                      $prop(iclass, '$$included', true);
                                      iclasses.push(iclass);
                                    }
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 1 hr to fix
                                opal/corelib/runtime.js on lines 1263..1267

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

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

                                    for (var i = 0, length = module_ancestors.length; i < length; i++) {
                                      var ancestor = module_ancestors[i], iclass = create_iclass(ancestor);
                                      $prop(iclass, '$$prepended', true);
                                      iclasses.push(iclass);
                                    }
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 1 hr to fix
                                opal/corelib/runtime.js on lines 1158..1162

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

                                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

                                      var key_hash = key.$$is_string ? key.valueOf() : (hash.$$by_identity ? Opal.id(key) : key.$hash()),
                                          objects = hash.$$keys.get(key_hash),
                                          object;
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 1 hr to fix
                                opal/corelib/runtime.js on lines 2388..2390

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

                                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

                                      var key_hash = key.$$is_string ? key.valueOf() : (hash.$$by_identity ? Opal.id(key) : key.$hash()),
                                          objects = hash.$$keys.get(key_hash),
                                          object;
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 1 hr to fix
                                opal/corelib/runtime.js on lines 2357..2359

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

                                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 (Opal.is_method(prop)) {
                                          var method = proto[prop];
                                
                                          if (!method.$$stub) {
                                            var method_name = prop.slice(1);
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 1 hr to fix
                                opal/corelib/runtime.js on lines 989..996

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

                                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 (Opal.is_method(prop)) {
                                        var method = proto[prop];
                                
                                        if (!method.$$stub) {
                                          var method_name = prop.slice(1);
                                Severity: Major
                                Found in opal/corelib/runtime.js and 1 other location - About 1 hr to fix
                                opal/corelib/runtime.js on lines 961..968

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

                                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

                                  Opal.neqeq = function(lhs, rhs) {
                                    return are_both_numbers_or_strings(lhs,rhs) ? lhs !== rhs : $truthy((lhs)['$!='](rhs));
                                  };
                                Severity: Minor
                                Found in opal/corelib/runtime.js and 1 other location - About 40 mins to fix
                                opal/corelib/runtime.js on lines 2943..2945

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

                                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

                                  Opal.eqeqeq = function(lhs, rhs) {
                                    return are_both_numbers_or_strings(lhs,rhs) ? lhs === rhs : $truthy((lhs)['$==='](rhs));
                                  };
                                Severity: Minor
                                Found in opal/corelib/runtime.js and 1 other location - About 40 mins to fix
                                opal/corelib/runtime.js on lines 2946..2948

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

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

                                    if ((cache = nesting.$$const_cache) == null) {
                                      $prop(nesting, '$$const_cache', Object.create(null));
                                      cache = nesting.$$const_cache;
                                    }
                                Severity: Minor
                                Found in opal/corelib/runtime.js and 1 other location - About 35 mins to fix
                                opal/corelib/runtime.js on lines 401..404

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

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

                                    if ((cache = cref.$$const_cache) == null) {
                                      $prop(cref, '$$const_cache', Object.create(null));
                                      cache = cref.$$const_cache;
                                    }
                                Severity: Minor
                                Found in opal/corelib/runtime.js and 1 other location - About 35 mins to fix
                                opal/corelib/runtime.js on lines 426..429

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

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

                                    if (!cref.$$is_module && !cref.$$is_class) {
                                      $raise(Opal.TypeError, cref.toString() + " is not a class/module");
                                    }
                                Severity: Minor
                                Found in opal/corelib/runtime.js and 1 other location - About 35 mins to fix
                                opal/corelib/runtime.js on lines 397..399

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

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

                                    if (!cref.$$is_module && !cref.$$is_class) {
                                      $raise(Opal.TypeError, cref.toString() + " is not a class/module");
                                    }
                                Severity: Minor
                                Found in opal/corelib/runtime.js and 1 other location - About 35 mins to fix
                                opal/corelib/runtime.js on lines 372..374

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

                                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

                                There are no issues that match your filters.

                                Category
                                Status