qcminecraft/Carbon-Forum-F

View on GitHub
static/editor/dialogs/video/video.js

Summary

Maintainability
F
2 wks
Test Coverage

Function initUploader has 363 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        initUploader: function () {
            var _this = this,
                $ = jQuery,    // just in case. Make sure it's not an other libaray.
                $wrap = _this.$wrap,
            // 图片容器
Severity: Major
Found in static/editor/dialogs/video/video.js - About 1 day to fix

    File video.js has 622 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Created by JetBrains PhpStorm.
     * User: taoqili
     * Date: 12-2-20
     * Time: 上午11:19
    Severity: Major
    Found in static/editor/dialogs/video/video.js - About 1 day to fix

      Function addFile has 117 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function addFile(file) {
                      var $li = $('<li id="' + file.id + '">' +
                              '<p class="title">' + file.name + '</p>' +
                              '<p class="imgWrap"></p>' +
                              '<p class="progress"><span></span></p>' +
      Severity: Major
      Found in static/editor/dialogs/video/video.js - About 4 hrs to fix

        Function setState has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function setState(val, files) {
        
                        if (val != state) {
        
                            var stats = uploader.getStats();
        Severity: Major
        Found in static/editor/dialogs/video/video.js - About 2 hrs to fix

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

                      function setState(val, files) {
          
                          if (val != state) {
          
                              var stats = uploader.getStats();
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 3 days to fix
          static/editor/dialogs/attachment/attachment.js on lines 341..415
          static/editor/dialogs/image/image.js on lines 556..630

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

          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 _this = this,
                          $ = jQuery,    // just in case. Make sure it's not an other libaray.
                          $wrap = _this.$wrap,
                      // 图片容器
                          $queue = $wrap.find('.filelist'),
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 1 other location - About 2 days to fix
          static/editor/dialogs/attachment/attachment.js on lines 102..148

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

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

                          var $li = $('<li id="' + file.id + '">' +
                                  '<p class="title">' + file.name + '</p>' +
                                  '<p class="imgWrap"></p>' +
                                  '<p class="progress"><span></span></p>' +
                                  '</li>'),
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
          static/editor/dialogs/attachment/attachment.js on lines 182..215
          static/editor/dialogs/image/image.js on lines 402..435

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

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

                          file.on('statuschange', function (cur, prev) {
                              if (prev === 'progress') {
                                  $prgress.hide().width(0);
                              } else if (prev === 'queued') {
                                  $li.off('mouseenter mouseleave');
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
          static/editor/dialogs/attachment/attachment.js on lines 251..273
          static/editor/dialogs/image/image.js on lines 466..488

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

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

                      function updateStatus() {
                          var text = '', stats;
          
                          if (state === 'ready') {
                              text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
          static/editor/dialogs/attachment/attachment.js on lines 417..439
          static/editor/dialogs/image/image.js on lines 632..654

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

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

                          $btns.on('click', 'span', function () {
                              var index = $(this).index(),
                                  deg;
          
                              switch (index) {
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 day to fix
          static/editor/dialogs/attachment/attachment.js on lines 282..310
          static/editor/dialogs/image/image.js on lines 497..525

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

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

                      function updateTotalProgress() {
                          var loaded = 0,
                              total = 0,
                              spans = $progress.children(),
                              percent;
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 7 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 323..339
          static/editor/dialogs/image/image.js on lines 538..554

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

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

                      uploader.on('all', function (type, files) {
                          switch (type) {
                              case 'uploadFinished':
                                  setState('confirm', files);
                                  break;
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 5 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 468..484
          static/editor/dialogs/image/image.js on lines 683..699

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

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

                      if (!WebUploader.Uploader.support()) {
                          $('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
                          return;
                      } else if (!editor.getOpt('videoActionName')) {
                          $('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 4 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 150..156
          static/editor/dialogs/image/image.js on lines 354..360

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

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

                  getQueueCount: function () {
                      var file, i, status, readyFile = 0, files = this.uploader.getFiles();
                      for (i = 0; file = files[i++]; ) {
                          status = file.getStatus();
                          if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 3 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 543..550
          static/editor/dialogs/image/image.js on lines 758..765

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

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

                      $upload.on('click', function () {
                          if ($(this).hasClass('disabled')) {
                              return false;
                          }
          
          
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 3 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 526..538
          static/editor/dialogs/image/image.js on lines 741..753

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

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

                      uploader.on('uploadProgress', function (file, percentage) {
                          var $li = $('#' + file.id),
                              $percent = $li.find('.progress span');
          
                          $percent.css('width', percentage * 100 + '%');
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 3 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 491..498
          static/editor/dialogs/image/image.js on lines 706..713

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

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

                      function removeFile(file) {
                          var $li = $('#' + file.id);
                          delete percentages[ file.id ];
                          updateTotalProgress();
                          $li.off().find('.file-panel').off().end().remove();
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 2 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 316..321
          static/editor/dialogs/image/image.js on lines 531..536

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

          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

                      uploader = _this.uploader = WebUploader.create({
                          pick: {
                              id: '#filePickerReady',
                              label: lang.uploadSelectFile
                          },
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 1 other location - About 2 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 158..169

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

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

                      uploader.on('filesQueued', function (file) {
                          if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) {
                              setState('ready');
                          }
                          updateTotalProgress();
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 2 hrs to fix
          static/editor/dialogs/attachment/attachment.js on lines 461..466
          static/editor/dialogs/image/image.js on lines 676..681

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

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

                      uploader.on('fileQueued', function (file) {
                          fileCount++;
                          fileSize += file.size;
          
                          if (fileCount === 1) {
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 hr to fix
          static/editor/dialogs/attachment/attachment.js on lines 441..451
          static/editor/dialogs/image/image.js on lines 656..666

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

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

                              if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) {
                                  showError('not_allow_type');
                                  uploader.removeFile(file);
                              }
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 hr to fix
          static/editor/dialogs/attachment/attachment.js on lines 245..248
          static/editor/dialogs/image/image.js on lines 460..463

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

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

              function UploadFile(target) {
                  this.$wrap = target.constructor == String ? $('#' + target) : $(target);
                  this.init();
              }
          Severity: Major
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 1 hr to fix
          static/editor/dialogs/attachment/attachment.js on lines 87..90
          static/editor/dialogs/image/image.js on lines 290..293

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

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

                      uploader.on('fileDequeued', function (file) {
                          fileCount--;
                          fileSize -= file.size;
          
                          removeFile(file);
          Severity: Minor
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 35 mins to fix
          static/editor/dialogs/attachment/attachment.js on lines 453..459
          static/editor/dialogs/image/image.js on lines 668..674

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

                      uploader.on('error', function (code, file) {
                          if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') {
                              addFile(file);
                          }
                      });
          Severity: Minor
          Found in static/editor/dialogs/video/video.js and 2 other locations - About 30 mins to fix
          static/editor/dialogs/attachment/attachment.js on lines 518..522
          static/editor/dialogs/image/image.js on lines 733..737

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

          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