publify/publify

View on GitHub

Showing 238 of 238 total issues

Function datetimepicker has 878 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.datetimepicker = function( opt ) {
        var KEY0 = 48,
            KEY9 = 57,
            _KEY0 = 96,
            _KEY9 = 105,
Severity: Major
Found in publify_core/app/assets/javascripts/datetimepicker.js - About 4 days to fix

    Function createDateTimePicker has 780 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                createDateTimePicker = function( input ) {
                    
                    var datetimepicker = $('<div '+(options.id?'id="'+options.id+'"':'')+' '+(options.style?'style="'+options.style+'"':'')+' class="xdsoft_datetimepicker xdsoft_noselect '+(options.weeks?' xdsoft_showweeks':'')+options.className+'"></div>'),
                        xdsoft_copyright = $('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),
                        datepicker = $('<div class="xdsoft_datepicker active"></div>'),
    Severity: Major
    Found in publify_core/app/assets/javascripts/datetimepicker.js - About 3 days to fix

      File bootstrap.js has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * Bootstrap v3.2.0 (http://getbootstrap.com)
       * Copyright 2011-2014 Twitter, Inc.
       * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
       */
      Severity: Major
      Found in themes/bootstrap-2/javascripts/bootstrap.js - About 3 days to fix

        File datetimepicker.js has 1254 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * @preserve jQuery DateTimePicker plugin v2.3.4
         * @homepage http://xdsoft.net/jqplugins/datetimepicker/
         * (c) 2014, Chupurnov Valeriy.
         */
        Severity: Major
        Found in publify_core/app/assets/javascripts/datetimepicker.js - About 3 days to fix

          File typeahead.js has 1130 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
           * typeahead.js 0.9.3
           * https://github.com/twitter/typeahead
           * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT
           */
          Severity: Major
          Found in publify_core/app/assets/javascripts/typeahead.js - About 2 days to fix

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

            +function ($) {
              'use strict';
            
              // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
              // ============================================================
            Severity: Major
            Found in themes/bootstrap-2/javascripts/bootstrap.js and 1 other location - About 2 days to fix
            publify_core/app/assets/javascripts/bootstrap/transition.js on lines 10..59

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

            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

            +function ($) {
              'use strict';
            
              // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
              // ============================================================
            Severity: Major
            Found in publify_core/app/assets/javascripts/bootstrap/transition.js and 1 other location - About 2 days to fix
            themes/bootstrap-2/javascripts/bootstrap.js on lines 18..67

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

            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

                this.padding = {
                  top: parseFloat(this.modal_dialog.css('padding-top')) + parseFloat(this.modal_content.css('padding-top')) + parseFloat(this.modal_body.css('padding-top')),
                  right: parseFloat(this.modal_dialog.css('padding-right')) + parseFloat(this.modal_content.css('padding-right')) + parseFloat(this.modal_body.css('padding-right')),
                  bottom: parseFloat(this.modal_dialog.css('padding-bottom')) + parseFloat(this.modal_content.css('padding-bottom')) + parseFloat(this.modal_body.css('padding-bottom')),
                  left: parseFloat(this.modal_dialog.css('padding-left')) + parseFloat(this.modal_content.css('padding-left')) + parseFloat(this.modal_body.css('padding-left'))
            Severity: Major
            Found in publify_core/app/assets/javascripts/lightbox.js and 1 other location - About 1 day to fix
            publify_core/app/assets/javascripts/lightbox.js on lines 37..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 256.

            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

                this.border = {
                  top: parseFloat(this.modal_dialog.css('border-top-width')) + parseFloat(this.modal_content.css('border-top-width')) + parseFloat(this.modal_body.css('border-top-width')),
                  right: parseFloat(this.modal_dialog.css('border-right-width')) + parseFloat(this.modal_content.css('border-right-width')) + parseFloat(this.modal_body.css('border-right-width')),
                  bottom: parseFloat(this.modal_dialog.css('border-bottom-width')) + parseFloat(this.modal_content.css('border-bottom-width')) + parseFloat(this.modal_body.css('border-bottom-width')),
                  left: parseFloat(this.modal_dialog.css('border-left-width')) + parseFloat(this.modal_content.css('border-left-width')) + parseFloat(this.modal_body.css('border-left-width'))
            Severity: Major
            Found in publify_core/app/assets/javascripts/lightbox.js and 1 other location - About 1 day to fix
            publify_core/app/assets/javascripts/lightbox.js on lines 43..48

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

            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

              Tooltip.prototype.enter = function (obj) {
                var self = obj instanceof this.constructor ?
                  obj : $(obj.currentTarget).data('bs.' + this.type)
            
                if (!self) {
            Severity: Major
            Found in themes/bootstrap-2/javascripts/bootstrap.js and 1 other location - About 1 day to fix
            themes/bootstrap-2/javascripts/bootstrap.js on lines 1222..1240

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

            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

              Tooltip.prototype.leave = function (obj) {
                var self = obj instanceof this.constructor ?
                  obj : $(obj.currentTarget).data('bs.' + this.type)
            
                if (!self) {
            Severity: Major
            Found in themes/bootstrap-2/javascripts/bootstrap.js and 1 other location - About 1 day to fix
            themes/bootstrap-2/javascripts/bootstrap.js on lines 1202..1220

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

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

                var TypeaheadView = function() {
                    var html = {
                        wrapper: '<span class="twitter-typeahead"></span>',
                        hint: '<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',
                        dropdown: '<span class="tt-dropdown-menu"></span>'
            Severity: Major
            Found in publify_core/app/assets/javascripts/typeahead.js - About 1 day to fix

              Function Dataset has 192 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var Dataset = function() {
                      var keys = {
                          thumbprint: "thumbprint",
                          protocol: "protocol",
                          itemHash: "itemHash",
              Severity: Major
              Found in publify_core/app/assets/javascripts/typeahead.js - About 7 hrs to fix

                Method change has 175 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def change
                    create_table "articles_tags", id: false, force: true do |t|
                      t.integer "article_id"
                      t.integer "tag_id"
                    end
                Severity: Major
                Found in publify_core/db/migrate/113_initial_schema.rb - About 7 hrs to fix

                  Function DropdownView has 167 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var DropdownView = function() {
                          var html = {
                              suggestionsList: '<span class="tt-suggestions"></span>'
                          }, css = {
                              suggestionsList: {
                  Severity: Major
                  Found in publify_core/app/assets/javascripts/typeahead.js - About 6 hrs to fix

                    Function setOptions has 163 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    datetimepicker.setOptions = function( _options ) {
                                        options = $.extend(true,{},options,_options);
                                        
                                        if( _options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length ){
                                            options['allowTimes'] = $.extend(true,[],_options.allowTimes);
                    Severity: Major
                    Found in publify_core/app/assets/javascripts/datetimepicker.js - About 6 hrs to fix

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

                        function Plugin(option, _relatedTarget) {
                          return this.each(function () {
                            var $this   = $(this)
                            var data    = $this.data('bs.modal')
                            var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
                      Severity: Major
                      Found in themes/bootstrap-2/javascripts/bootstrap.js and 1 other location - About 6 hrs to fix
                      publify_core/app/assets/javascripts/bootstrap/modal.js on lines 308..318

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

                      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

                        function Plugin(option, _relatedTarget) {
                          return this.each(function () {
                            var $this = $(this)
                            var data = $this.data('bs.modal')
                            var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
                      Severity: Major
                      Found in publify_core/app/assets/javascripts/bootstrap/modal.js and 1 other location - About 6 hrs to fix
                      themes/bootstrap-2/javascripts/bootstrap.js on lines 1052..1062

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

                      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

                          showYoutubeVideo: function(id) {
                            var aspectRatio, height, width;
                            aspectRatio = 560 / 315;
                            width = this.$element.data('width') || 560;
                            width = this.checkDimensions(width);
                      Severity: Major
                      Found in publify_core/app/assets/javascripts/lightbox.js and 1 other location - About 6 hrs to fix
                      publify_core/app/assets/javascripts/lightbox.js on lines 244..255

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

                      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

                          showVimeoVideo: function(id) {
                            var aspectRatio, height, width;
                            aspectRatio = 500 / 281;
                            width = this.$element.data('width') || 560;
                            width = this.checkDimensions(width);
                      Severity: Major
                      Found in publify_core/app/assets/javascripts/lightbox.js and 1 other location - About 6 hrs to fix
                      publify_core/app/assets/javascripts/lightbox.js on lines 232..243

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

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

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

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

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

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language