AgileVentures/WebsiteOne

View on GitHub

Showing 63 of 206 total issues

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

  (function() {
    var modules = [],
      newPageLoaded = false,
      runOnceCallbacks = {},
      moduleFactories = {};
Severity: Major
Found in app/assets/javascripts/websiteone.js - About 2 hrs to fix

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

    var Datepicker = function(element, options){
        $.data(element, 'datepicker', this);

        this._events = [];
        this._secondaryEvents = [];
Severity: Major
Found in app/assets/javascripts/bootstrap-datepicker.js - About 2 hrs to fix

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

    function init() {
        $('.yt_link').on('click', selectVideo);

        $('#skills').tags({
            readOnly: false,
Severity: Major
Found in app/assets/javascripts/users.js - About 2 hrs to fix

Function initialize has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            initialize: function initialize(o, datasets) {
                var www;
                datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1);
                o = o || {};
                www = WWW(o.classNames);
Severity: Major
Found in app/assets/javascripts/typeahead.jquery.js - About 2 hrs to fix

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

        _fill_yearsView: function(selector, cssClass, factor, year, startYear, endYear, beforeFn){
            var html = '';
            var step = factor / 10;
            var view = this.picker.find(selector);
            var startVal = Math.floor(year / factor) * factor;
Severity: Minor
Found in app/assets/javascripts/bootstrap-datepicker.js - About 2 hrs to fix

Function EventCountdown has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function EventCountdown() {
        var countdownClock, eventName, eventTime, eventDuration, eventUrl, textToAppend;
        var self = this;

        this.format = function(num) {
Severity: Minor
Found in app/assets/javascripts/global-modules/event_countdown.js - About 1 hr to fix

Function Status has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var Status = function() {
        "use strict";
        function Status(options) {
            this.$el = $("<span></span>", {
                role: "status",
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix

Function attach has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                function attach() {
                    var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor;
                    _.each(datasets, function(d) {
                        d.highlight = !!o.highlight;
                    });
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix

Function buildCss has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function buildCss() {
            var css = {
                wrapper: {
                    position: "relative",
                    display: "inline-block"
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix

Function click has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        click: function(e){
            e.preventDefault();
            e.stopPropagation();

            var target, dir, day, year, month;
Severity: Minor
Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

Function DefaultMenu has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var DefaultMenu = function() {
        "use strict";
        var s = Menu.prototype;
        function DefaultMenu() {
            Menu.apply(this, [].slice.call(arguments, 0));
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix

Function css has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var css = (function() {
    var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ],
        cssProps    = {};

    function camelCase(string) {
Severity: Minor
Found in app/assets/javascripts/nprogress.js - About 1 hr to fix

Function getClassNames has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getClassNames: function(date){
            var cls = [],
                year = this.viewDate.getUTCFullYear(),
                month = this.viewDate.getUTCMonth(),
                today = UTCToday();
Severity: Minor
Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

Function DateArray has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var DateArray = (function(){
        var extras = {
            get: function(i){
                return this.slice(i)[0];
            },
Severity: Minor
Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

Function datepickerPlugin has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var datepickerPlugin = function(option){
        var args = Array.apply(null, arguments);
        args.shift();
        var internal_return;
        this.each(function(){
Severity: Minor
Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

Function moveMonth has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        moveMonth: function(date, dir){
            if (!isValidDate(date))
                return this.o.defaultViewDate;
            if (!dir)
                return date;
Severity: Minor
Found in app/assets/javascripts/bootstrap-datepicker.js - About 1 hr to fix

Function WebsiteOne has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  (function() {
    var modules = [],
      newPageLoaded = false,
      runOnceCallbacks = {},
      moduleFactories = {};
Severity: Minor
Found in app/assets/javascripts/websiteone.js - About 1 hr 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 Typeahead has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function Typeahead(o, www) {
            var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged;
            o = o || {};
            if (!o.input) {
                $.error("missing input");
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix

Function EventBus has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var EventBus = function() {
        "use strict";
        var namespace, deprecationMap;
        namespace = "typeahead:";
        deprecationMap = {
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix

Function update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            update: function update(query) {
                var that = this, canceled = false, syncCalled = false, rendered = 0;
                this.cancel();
                this.cancel = function cancel() {
                    canceled = true;
Severity: Minor
Found in app/assets/javascripts/typeahead.jquery.js - About 1 hr to fix
Severity
Category
Status
Source
Language