cyberbit/modation

View on GitHub

Showing 77 of 1,299 total issues

File opentip-jquery.custom.js has 1673 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Generated by CoffeeScript 1.4.0
/*
#
# Opentip v2.4.6 (Custom Build)
#
Severity: Major
Found in src/js/opentip-jquery.custom.js - About 4 days to fix

File newoptions.js has 729 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var lastPage;
var save = true;
var tracks = [];
var pages = [];
var trackInfo = [];
Severity: Major
Found in src/js/newoptions.js - About 1 day to fix

File options.js has 660 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var lastPage;
var save = true;
var tracks = [];
var pages = [];
var trackInfo = [];
Severity: Major
Found in src/js/options.js - About 1 day to fix

Function alarmHandler has 262 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function alarmHandler(alarm) {
        var views = chrome.extension.getViews({type: "popup"});
        var options = localJSON("options") || {};
        
        //Login
Severity: Major
Found in src/js/eventPage.js - About 1 day to fix

File eventPage.js has 518 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//Switch for alarm state
var alarmRunning = false;

//Storage for runtime event functions
var msgFunctions = {};
Severity: Major
Found in src/js/eventPage.js - About 1 day to fix

Function _draw has 206 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Opentip.prototype._draw = function() {
    var backgroundCanvas, bulge, canvasDimensions, canvasPosition, closeButton, closeButtonInner, closeButtonOuter, ctx, drawCorner, drawLine, hb, position, stemBase, stemLength, _i, _len, _ref, _ref1, _ref2,
      _this = this;
    if (!(this.backgroundCanvas && this.redraw)) {
      return;
Severity: Major
Found in src/js/opentip-jquery.custom.js - About 1 day to fix

Function Joint has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

Opentip.Joint = (function() {

  function Joint(pointerString) {
    if (pointerString == null) {
      return;
Severity: Minor
Found in src/js/opentip-jquery.custom.js - About 6 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 Opentip has 154 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function Opentip(element, content, title, options) {
    var elementsOpentips, hideTrigger, methodToBind, optionSources, prop, styleName, _i, _j, _len, _len1, _ref, _ref1, _ref2, _tmpStyle,
      _this = this;
    this.id = ++Opentip.lastId;
    this.debug("Creating Opentip.");
Severity: Major
Found in src/js/opentip-jquery.custom.js - About 6 hrs to fix

Function preinit has 150 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function preinit() {
    $.get(chrome.extension.getURL("content.html"), function(d) {
        $("body").append(d);
        
        crapi.clone(function(d) {
Severity: Major
Found in src/js/content.js - About 6 hrs to fix

Function check_watchlist has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function check_watchlist(update, callback) {
    if (typeof update == "undefined") update = true;
    if (typeof callback == "undefined") callback = function(){};
    
    var email = $('#email').val();
Severity: Major
Found in src/js/newoptions.js - About 5 hrs to fix

Function check_watchlist has 129 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function check_watchlist(update, callback) {
    if (typeof update == "undefined") update = true;
    if (typeof callback == "undefined") callback = function(){};
    
    var email = $('#email').val();
Severity: Major
Found in src/js/options.js - About 5 hrs to fix

Function getPosition has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Opentip.prototype.getPosition = function(tipJoint, targetJoint, stem) {
    var additionalHorizontal, additionalVertical, offsetDistance, position, stemLength, targetDimensions, targetPosition, unwrappedTarget, _ref;
    if (!this.container) {
      return;
    }
Severity: Major
Found in src/js/opentip-jquery.custom.js - About 4 hrs to fix

Function parseNotifs has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function parseNotifs() {
    //Grab storage
    crapi.clone(function(d) {
        //Login
        modapi.login(function(me) {
Severity: Major
Found in src/js/popup.js - About 3 hrs to fix

Function _ensureViewportContainment has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Opentip.prototype._ensureViewportContainment = function(position) {
    var needsRepositioning, newSticksOut, originals, revertedX, revertedY, scrollOffset, stem, sticksOut, targetJoint, tipJoint, viewportDimensions, viewportPosition;
    stem = this.options.stem;
    originals = {
      position: position,
Severity: Major
Found in src/js/opentip-jquery.custom.js - About 3 hrs to fix

Function _iterate has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function _iterate() {
            var wChanged = [];
            
            $.each(wParsed, function(i, v) {
                var wItem = v;
Severity: Major
Found in src/js/newoptions.js - About 3 hrs to fix

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

        function _iterate() {
            var wChanged = [];
            
            $.each(wParsed, function(i, v) {
                var wItem = v;
Severity: Major
Found in src/js/options.js - About 3 hrs to fix

File crapi.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* exported handle, getBlob, getDataUri, localJSON, showView, _factory */

/*!
 * App Helpers
 */
Severity: Minor
Found in src/js/crapi.js - About 3 hrs to fix

Function Joint has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Opentip.Joint = (function() {

  function Joint(pointerString) {
    if (pointerString == null) {
      return;
Severity: Major
Found in src/js/opentip-jquery.custom.js - About 3 hrs to fix

Function editTrack has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function editTrack(id, page) {
    if (!$('#tab-tracks aside').length) {
        $('#tab-tracks').prepend('<aside style="display: none">' +
            '<div class="container">' +
                '<div class="aside-cover"><img src="img/loadingealarget.gif"></div>' +
Severity: Major
Found in src/js/newoptions.js - About 3 hrs to fix

Function editTrack has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function editTrack(id, page) {
    if (!$('#tab-tracks aside').length) {
        $('#tab-tracks').prepend('<aside style="display: none">' +
            '<div class="container">' +
                '<div class="aside-cover"><img src="img/loadingealarget.gif"></div>' +
Severity: Major
Found in src/js/options.js - About 3 hrs to fix
Severity
Category
Status
Source
Language