betajs/betajs-debug

View on GitHub

Showing 18 of 18 total issues

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

                    Hooks.hookMethod("setInterval", ctx, null,function (m, c, args, handle) {
                        if (!handle)
                            return;
                        result.intervals[handleConvert(handle)] = {
                            func: args[0],
Severity: Major
Found in src/debug/timers.js and 1 other location - About 2 hrs to fix
src/debug/timers.js on lines 44..52

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

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

                    Hooks.hookMethod("setTimeout", ctx, null,function (m, c, args, handle) {
                        if (!handle)
                            return;
                        result.timeouts[handleConvert(handle)] = {
                            func: args[0],
Severity: Major
Found in src/debug/timers.js and 1 other location - About 2 hrs to fix
src/debug/timers.js on lines 28..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 78.

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

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

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

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

Refactorings

Further Reading

Function hookTimers has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        hookTimers: function () {
            var handleCounter = 0;
            var handleConvert = function (handle) {
                if (typeof handle === "number")
                    return handle;
Severity: Major
Found in src/debug/timers.js - About 2 hrs to fix

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

                    suspend: function () {
                        this._suspended++;
                        if (this._entered > 0 && this._suspended === 1)
                            this._time += Timing.now() - this._startTime;
                    },
    Severity: Major
    Found in src/debug/profiler.js and 1 other location - About 1 hr to fix
    src/debug/profiler.js on lines 27..31

    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

                    leave: function () {
                        this._entered--;
                        if (this._entered === 0 && this._suspended < 1)
                            this._time += Timing.now() - this._startTime;
                    },
    Severity: Major
    Found in src/debug/profiler.js and 1 other location - About 1 hr to fix
    src/debug/profiler.js on lines 33..37

    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

    Function createProfile has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            createProfile: function () {
                return {
                    
                    _entered: 0,
                    _suspended: 0,
    Severity: Minor
    Found in src/debug/profiler.js - About 1 hr to fix

      Function monitorInstances has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              monitorInstances: function (baseClass, filter) {
                  var instances = {};
                  var logchange = function (cls, delta, cid) {
                      var current = cls;
                      while (current) {
      Severity: Minor
      Found in src/debug/instances.js - About 1 hr to fix

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

                profilePrototypeMethod: function (method, cls) {
                    var profile = this.createProfile();
                    return {
                        profile: profile,
                        hook: Hooks.hookPrototypeMethod(method, cls, profile.enter, profile.leave, profile)
        Severity: Major
        Found in src/debug/profiler.js and 1 other location - About 1 hr to fix
        src/debug/profiler.js on lines 69..75

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

        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

                profileMethod: function (method, context) {
                    var profile = this.createProfile();
                    return {
                        profile: profile,
                        hook: Hooks.hookMethod(method, context, profile.enter, profile.leave, profile)
        Severity: Major
        Found in src/debug/profiler.js and 1 other location - About 1 hr to fix
        src/debug/profiler.js on lines 77..83

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

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

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

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

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

        Refactorings

        Further Reading

        Function monitorInstances has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                monitorInstances: function (baseClass, filter) {
                    var classes = {};
                    var beginCallMethod = function (method, instance) {
                        var methods = classes[instance.cls.classname].methods;
                        methods[method] = methods[method] || {
        Severity: Minor
        Found in src/debug/methods.js - About 1 hr to fix

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

                              Hooks.hookMethod("clearTimeout", ctx, function (m, c, args) {
                                  if (!args[0])
                                      return;
                                  delete result.timeouts[handleConvert(args[0])];
                              })
          Severity: Minor
          Found in src/debug/timers.js and 1 other location - About 50 mins to fix
          src/debug/timers.js on lines 38..42

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

          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

                              Hooks.hookMethod("clearInterval", ctx, function (m, c, args) {
                                  if (!args[0])
                                      return;
                                  delete result.intervals[handleConvert(args[0])];
                              }),
          Severity: Minor
          Found in src/debug/timers.js and 1 other location - About 50 mins to fix
          src/debug/timers.js on lines 54..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 51.

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

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

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

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

          Refactorings

          Further Reading

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

                      var constructorHook = Hooks.hookMethod("constructor", baseClass.prototype, undefined, function (method, ctx, args, result, exc, instance) {
          Severity: Minor
          Found in src/debug/instances.js - About 45 mins to fix

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

                        for (var i = 0; i < includedPrototypes.length; ++i)
                            Hooks.hookPrototypeMethods(includedPrototypes[i], profile.enter, profile.leave, profile);
            Severity: Minor
            Found in src/debug/profiler.js and 1 other location - About 45 mins to fix
            src/debug/profiler.js on lines 64..65

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

            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

                        for (var e = 0; e < excludedPrototypes.length; ++e)
                            Hooks.hookPrototypeMethods(excludedPrototypes[e], profile.suspend, profile.resume, profile);
            Severity: Minor
            Found in src/debug/profiler.js and 1 other location - About 45 mins to fix
            src/debug/profiler.js on lines 62..63

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

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

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

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

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

            Refactorings

            Further Reading

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

                    hookPrototypeMethod: function (method, cls, beginCallback, endCallback, callbackContext) {
            Severity: Minor
            Found in src/debug/hooks.js - About 35 mins to fix

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

                      hookMethod: function (method, context, beginCallback, endCallback, callbackContext) {
              Severity: Minor
              Found in src/debug/hooks.js - About 35 mins to fix

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

                        hookMethodsArray: function (methods, context, beginCallback, endCallback, callbackContext) {
                Severity: Minor
                Found in src/debug/hooks.js - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language