publify/publify

View on GitHub

Showing 101 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

            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

                      File quicktags.js has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // JS QuickTags version 1.3.1
                      //
                      // Copyright (c) 2002-2008 Alex King
                      // http://alexking.org/projects/js-quicktags
                      //
                      Severity: Minor
                      Found in publify_core/app/assets/javascripts/quicktags.js - About 5 hrs to fix

                        Function InputView has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var InputView = function() {
                                function InputView(o) {
                                    var that = this;
                                    utils.bindAll(this);
                                    this.specialKeyCodeMap = {
                        Severity: Major
                        Found in publify_core/app/assets/javascripts/typeahead.js - About 4 hrs to fix

                          Class Article has 37 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Article < Content
                            include PublifyGuid
                            include ConfigManager
                          
                            serialize :settings, Hash
                          Severity: Minor
                          Found in publify_core/app/models/article.rb - About 4 hrs to fix

                            Consider simplifying this complex logical expression.
                            Open

                                                if( options.mask ) {
                                                    var e,
                                                        getCaretPos = function ( input ) {
                                                            try{
                                                                if ( document.selection && document.selection.createRange ) {
                            Severity: Critical
                            Found in publify_core/app/assets/javascripts/datetimepicker.js - About 4 hrs to fix

                              File tagmanager.js has 340 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /* ===================================================
                               * tagmanager.js v3.0.1
                               * http://welldonethings.com/tags/manager
                               * ===================================================
                               * Copyright 2012 Max Favilli
                              Severity: Minor
                              Found in publify_core/app/assets/javascripts/tagmanager.js - About 4 hrs to fix

                                File lightbox.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /*
                                Lightbox for Bootstrap 3 by @ashleydw
                                https://github.com/ashleydw/lightbox
                                
                                License: https://github.com/ashleydw/lightbox/blob/master/LICENSE
                                Severity: Minor
                                Found in publify_core/app/assets/javascripts/lightbox.js - About 4 hrs to fix

                                  Function _xdsoft_datetime has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                                  var _xdsoft_datetime = new function() {
                                                      var _this = this;
                                                      _this.now = function( norecursion ) {
                                                          var d = new Date();
                                                          
                                  Severity: Major
                                  Found in publify_core/app/assets/javascripts/datetimepicker.js - About 4 hrs to fix

                                    Function init has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            init : function (options) {
                                                var opts = $.extend({}, defaults, options), delimiters, keyNums;
                                    
                                                opts.hiddenTagListName = (opts.hiddenTagListName === null)
                                                    ? 'hidden-' + this.attr('name')
                                    Severity: Major
                                    Found in publify_core/app/assets/javascripts/tagmanager.js - About 4 hrs to fix

                                      Function xdsoftScroller has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          $.fn.xdsoftScroller = function( _percent ) {
                                              return this.each(function() {
                                                  var timeboxparent = $(this);
                                                  if( !$(this).hasClass('xdsoft_scroller_box') ) {
                                                      var pointerEventToXY = function( e ) {
                                      Severity: Major
                                      Found in publify_core/app/assets/javascripts/datetimepicker.js - About 3 hrs to fix

                                        Method macrofilter has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                              def self.macrofilter(attrib, _text = "")
                                                # FIXME: style is not used
                                                # style = attrib['style']
                                                caption = attrib["caption"]
                                                title = attrib["title"]
                                        Severity: Minor
                                        Found in lib/publify_textfilter_lightbox.rb - About 3 hrs to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language