betajs/betajs-browser

View on GitHub

Showing 83 of 83 total issues

File dom.js has 597 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:Dom", [
    "base:Types",
    "base:Objs",
    "module:Info",
    "base:Async"
Severity: Major
Found in src/dom/dom.js - About 1 day to fix

    File info.js has 488 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    Scoped.define("module:Info", [
        "base:Objs", "module:FlashDetect"
    ], function(Objs, FlashDetect) {
        return {
    
    
    Severity: Minor
    Found in src/browser/info.js - About 7 hrs to fix

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

                              AjaxSupport.execute(Objs.extend({
                                  method: this._options.method,
                                  uri: this._options.assembly.url || this._options.url,
                                  data: Objs.extend(data, this._options.data)
                              }, this._options.assembly.ajaxOptions)).success(function() {
      Severity: Major
      Found in src/uploads/chunked_file_uploader.js and 1 other location - About 5 hrs to fix
      src/uploads/streaming_file_uploader.js on lines 82..90

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

      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

                          AjaxSupport.execute(Objs.extend({
                              method: this._options.method,
                              uri: this._options.assembly.url || this._options.url,
                              data: Objs.extend(data, this._options.data)
                          }, this._options.assembly.ajaxOptions)).success(function() {
      Severity: Major
      Found in src/uploads/streaming_file_uploader.js and 1 other location - About 5 hrs to fix
      src/uploads/chunked_file_uploader.js on lines 81..89

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

      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

              loadFileIntoString: function(file) {
                  var promise = Promise.create();
                  try {
                      var fileReader = new FileReader();
                      fileReader.onloadend = function(ev) {
      Severity: Major
      Found in src/browser/blobs.js and 1 other location - About 4 hrs to fix
      src/browser/blobs.js on lines 25..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 128.

      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

              loadFileIntoArrayBuffer: function(file) {
                  var promise = Promise.create();
                  try {
                      var fileReader = new FileReader();
                      fileReader.onloadend = function(ev) {
      Severity: Major
      Found in src/browser/blobs.js and 1 other location - About 4 hrs to fix
      src/browser/blobs.js on lines 39..51

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

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

      module.exports = function(grunt) {
      
          var pkg = grunt.file.readJSON('package.json');
          var gruntHelper = require('betajs-compile');
          var dist = 'betajs-browser';
      Severity: Major
      Found in Gruntfile.js - About 4 hrs to fix

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

                androidVersion: function() {
                    return this.__cached("androidVersion", function(nav) {
                        if (!this.isAndroid())
                            return false;
                        var v = (nav.userAgent).match(/Android (\d+)\.(\d+)\.?(\d+)?/);
        Severity: Major
        Found in src/browser/info.js and 1 other location - About 3 hrs to fix
        src/browser/info.js on lines 134..145

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

        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

                iOSversion: function() {
                    return this.__cached("iOSversion", function(nav) {
                        if (!this.isiOS())
                            return false;
                        var v = (nav.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
        Severity: Major
        Found in src/browser/info.js and 1 other location - About 3 hrs to fix
        src/browser/info.js on lines 147..158

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

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

                embedTemplate: function(options) {
                    options = options || {};
                    var params = [];
                    params.push({
                        "objectKey": "classid",
        Severity: Major
        Found in src/browser/flash.js - About 3 hrs to fix

          Function _upload has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _upload: function() {
                      var self = this;
                      var iframe = document.createElement("iframe");
                      var id = "upload-iframe-" + this.cid();
                      iframe.id = id;
          Severity: Major
          Found in src/uploads/form_iframe_file_uploader.js - About 2 hrs to fix

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

                        if (window.getSelection) {
                            selection = window.getSelection();
                            selection.removeAllRanges();
                            range = document.createRange();
                        } else if (document.selection) {
            Severity: Major
            Found in src/dom/selection.js and 1 other location - About 2 hrs to fix
            src/dom/selection.js on lines 148..155

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

            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 (window.getSelection) {
                            selection = window.getSelection();
                            selection.removeAllRanges();
                            range = document.createRange();
                        } else if (document.selection) {
            Severity: Major
            Found in src/dom/selection.js and 1 other location - About 2 hrs to fix
            src/dom/selection.js on lines 10..17

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 86.

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

                    execute: function(options, progress, progressCtx, xmlhttp) {
                        var uri = Uri.appendUriParams(options.uri, options.query || {});
                        if (!options.methodSupportsPayload)
                            uri = Uri.appendUriParams(uri, options.data || {});
                        var promise = Promise.create();
            Severity: Major
            Found in src/ajax/xml_http_request_ajax.js - About 2 hrs to fix

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

                              if (this.state() === "uploading") {
                                  if (uploader.state() === "error")
                                      uploader.reset();
                                  if (uploader.state() === "idle" && this._uploadingCount < this._uploadLimit) {
                                      this._uploadingCount++;
              Severity: Major
              Found in src/uploads/multi_uploader.js and 1 other location - About 2 hrs to fix
              src/uploads/multi_uploader.js on lines 39..46

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

              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

                              Objs.iter(this._uploaders, function(uploader) {
                                  if (uploader.state() === "error")
                                      uploader.reset();
                                  if (uploader.state() === "idle" && this._uploadingCount < this._uploadLimit) {
                                      this._uploadingCount++;
              Severity: Major
              Found in src/uploads/multi_uploader.js and 1 other location - About 2 hrs to fix
              src/uploads/multi_uploader.js on lines 27..34

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

              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

              File flash.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
              Copyright (c) Copyright (c) 2007, Carl S. Yestrau All rights reserved.
              Code licensed under the BSD License: http://www.featureblend.com/license.txt
              Version: 1.0.4
              */
              Severity: Minor
              Found in src/browser/flash.js - About 2 hrs to fix

                Function execute has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        execute: function(options) {
                            var postmessageName = "postmessage_" + Tokens.generate_token() + "_" + (id++);
                            var params = Objs.objectBy(options.postmessage, postmessageName);
                            params = Objs.extend(params, options.query);
                            var uri = Uri.appendUriParams(options.uri, params);
                Severity: Major
                Found in src/ajax/iframe_postmessage_ajax.js - About 2 hrs to fix

                  Function execute has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          execute: function(options) {
                              var callbackName = "jsonp_" + Tokens.generate_token() + "_" + (id++);
                              var params = Objs.objectBy(options.jsonp, callbackName);
                              params = Objs.extend(params, options.query);
                              params = Objs.extend(params, options.data);
                  Severity: Minor
                  Found in src/ajax/jsonp_script_ajax.js - About 2 hrs to fix

                    Function handleKeyEvent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            handleKeyEvent: function(hotkey, e, options) {
                                options = Objs.extend({
                                    "disable_in_input": false,
                                    "keycode": false
                                }, options);
                    Severity: Minor
                    Found in src/browser/hotkeys.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language