colorgy/Books

View on GitHub

Showing 122 of 200 total issues

Function 1 has 609 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Select = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
Severity: Major
Found in app/assets/javascripts/supplier/components/select.js - About 3 days to fix

    File picker.date.js has 852 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Date picker for pickadate.js v3.5.0
     * http://amsul.github.io/pickadate.js/date.htm
     */
    
    
    Severity: Major
    Found in app/assets/javascripts/materialize/date_picker/picker.date.js - About 2 days to fix

      Function PickerConstructor has 394 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
      
          // If there’s no element, return the picker constructor.
          if ( !ELEMENT ) return PickerConstructor
      
      
      Severity: Major
      Found in app/assets/javascripts/materialize/date_picker/picker.js - About 1 day to fix

        File select.js has 657 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Select = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
        (function (global){
        'use strict';
        
        var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
        Severity: Major
        Found in app/assets/javascripts/supplier/components/select.js - About 1 day to fix

          Function nodes has 266 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          DatePicker.prototype.nodes = function( isOpen ) {
          
              var
                  calendar = this,
                  settings = calendar.settings,
          Severity: Major
          Found in app/assets/javascripts/materialize/date_picker/picker.date.js - About 1 day to fix

            File picker.js has 539 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * pickadate.js v3.5.0, 2014/04/13
             * By Amsul, http://amsul.ca
             * Hosted on http://amsul.github.io/pickadate.js
             * Licensed under MIT
            Severity: Major
            Found in app/assets/javascripts/materialize/date_picker/picker.js - About 1 day to fix

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

                  init : function(options) {
                    var defaults = {
                      menuWidth: 240,
                      edge: 'left',
                      closeOnClick: false
              Severity: Major
              Found in app/assets/javascripts/materialize/sideNav.js - About 1 day to fix

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

                    init : function(options) {
                      var defaults = {
                        indicators: true,
                        height: 400,
                        transition: 500,
                Severity: Major
                Found in app/assets/javascripts/materialize/slider.js - About 7 hrs to fix

                  Function materialbox has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    $.fn.materialbox = function () {
                  
                      return this.each(function() {
                  
                        if ($(this).hasClass('initialized')) {
                  Severity: Major
                  Found in app/assets/javascripts/materialize/materialbox.js - About 7 hrs to fix

                    Function tooltip has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        $.fn.tooltip = function (options) {
                            var timeout = null,
                            counter = null,
                            started = false,
                            counterInterval = null,
                    Severity: Major
                    Found in app/assets/javascripts/materialize/tooltip.js - About 5 hrs to fix

                      Function material_select has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        $.fn.material_select = function (callback) {
                          $(this).each(function(){
                            $select = $(this);
                      
                            if ( $select.hasClass('browser-default')) {
                      Severity: Major
                      Found in app/assets/javascripts/materialize/forms.js - About 5 hrs to fix

                        Function dropdown has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          $.fn.dropdown = function (option) {
                            var defaults = {
                              inDuration: 300,
                              outDuration: 225,
                              constrain_width: true, // Constrains width of dropdown to the activator
                        Severity: Major
                        Found in app/assets/javascripts/materialize/dropdown.js - About 4 hrs to fix

                          Method checkout has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def checkout(bill_attrs = {}, package_attrs: {})
                              check_cart!
                              return { orders: [], bill: nil } unless Settings.open_for_orders
                              return { orders: [], bill: nil } if cart_items.blank?
                          
                          
                          Severity: Minor
                          Found in app/models/concerns/can_purchase.rb - About 4 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

                          Function 1 has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AutosizeInput = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                          (function (global){
                          'use strict';
                          
                          var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
                          Severity: Major
                          Found in app/assets/javascripts/supplier/components/input_autosize.js - About 3 hrs to fix

                            `` has 31 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            {
                                def: 'easeOutQuad',
                                swing: function (x, t, b, c, d) {
                                    //alert(jQuery.easing.default);
                                    return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
                            Severity: Minor
                            Found in app/assets/javascripts/materialize/jquery.easing.1.3.js - About 3 hrs to fix

                              File forms.js has 326 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              (function ($) {
                                $(document).ready(function() {
                              
                                  // Function to update labels of text fields
                                  Materialize.updateTextFields = function() {
                              Severity: Minor
                              Found in app/assets/javascripts/materialize/forms.js - About 3 hrs to fix

                                Function toast has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                Open

                                Materialize.toast = function (message, displayLength, className, completeCallback) {
                                    className = className || "";
                                
                                    var container = document.getElementById('toast-container');
                                
                                
                                Severity: Minor
                                Found in app/assets/javascripts/materialize/toasts.js - 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

                                Function render has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render: function render() {
                                    var selectClass = classes('Select', this.props.className, {
                                      'is-multi': this.props.multi,
                                      'is-searchable': this.props.searchable,
                                      'is-open': this.state.isOpen,
                                Severity: Major
                                Found in app/assets/javascripts/supplier/components/select.js - About 3 hrs to fix

                                  Function toast has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Materialize.toast = function (message, displayLength, className, completeCallback) {
                                      className = className || "";
                                  
                                      var container = document.getElementById('toast-container');
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/materialize/toasts.js - About 3 hrs to fix

                                    Function handleInputKeyDown has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      handleInputKeyDown: function(e) {
                                        autoPreview = this.props.autoPreview;
                                        // console.log(e.key);
                                        // console.log(e.keyCode);
                                        switch (e.key) {
                                    Severity: Minor
                                    Found in app/assets/javascripts/components/autocompelete_input.js.jsx - 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