Showing 77 of 1,299 total issues
Function initStorage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initStorage() {
var $tab = $("#tab-storage");
var $copyBox = $(".storage-copy");
var $confirm = $(".storage-confirm");
- Create a ticketCreate a ticket
Function initStorage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initStorage() {
var $tab = $("#tab-storage");
var $copyBox = $(".storage-copy");
var $confirm = $(".storage-confirm");
- Create a ticketCreate a ticket
Function initWatchlist
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initWatchlist() {
var link = global.path.home + location.pathname;
// Request watchlist type
chrome.runtime.sendMessage({action: "watchlistItemType", link: link}, function(result) {
- Create a ticketCreate a ticket
Function _loadAjax
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Opentip.prototype._loadAjax = function() {
var ajaxCallback = this.options.ajaxCallback || function(d){return d};
var _this = this;
if (this.loading) {
return;
- Create a ticketCreate a ticket
Function show
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Opentip.prototype.show = function() {
var _this = this;
this._abortHiding();
if (this.visible) {
return;
- Create a ticketCreate a ticket
Function _setupObservers
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Opentip.prototype._setupObservers = function() {
var observeOrStop, removeObserver, state, states, trigger, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2,
_this = this;
states = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
for (_i = 0, _len = states.length; _i < _len; _i++) {
- Create a ticketCreate a ticket
Function initNotifs
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initNotifs() {
//Click handler
chrome.notifications.onClicked.addListener(function(notifId) {
var data = notifData(notifId);
- Create a ticketCreate a ticket
Function _setup
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Opentip.prototype._setup = function() {
var hideOn, hideTrigger, hideTriggerElement, i, _i, _j, _len, _len1, _ref, _ref1, _results;
this.debug("Setting up the tooltip.");
this._buildContainer();
this.hideTriggers = [];
- Create a ticketCreate a ticket
Function hide
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Opentip.prototype.hide = function() {
var _this = this;
this._abortShowing();
if (!this.visible) {
return;
- Create a ticketCreate a ticket
Function parseWatchlist
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parseWatchlist() {
//Show loader
$("#modation-watchlist .loader").show();
crapi.clone(function(d) {
- Create a ticketCreate a ticket
Function findElements
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
Opentip.findElements = function() {
var adapter, content, element, optionName, optionValue, options, _i, _len, _ref, _results;
adapter = Opentip.adapter;
_ref = adapter.findAll(document.body, "[data-ot]");
_results = [];
- Read upRead up
- Create a ticketCreate a ticket
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 _updateView
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(function _updateView() {
// Use ~ trick to convert index result into coerced boolean
// (see http://stackoverflow.com/a/12299678)
var watched = ~watchedIndex;
- Create a ticketCreate a ticket
Function storageTest1
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CrAPI.prototype.tests.storageTest1 = function(next) {
console.groupCollapsed("Test Chrome storage functions");
try {
var _this = this;
- Create a ticketCreate a ticket
Function storageTest2
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CrAPI.prototype.tests.storageTest2 = function(next) {
console.groupCollapsed("Test CrAPI storage functions");
try {
var _this = this;
- Create a ticketCreate a ticket
Function initUpdate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initUpdate(details) {
//console.log("initUpdate: %o", details);
// Clone storage
crapi.clone($.extend(true, {}, global.storageModel, {options: global.optionDefaults}), function(d) {
- Create a ticketCreate a ticket
Function preinit
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function preinit() {
$.get(chrome.extension.getURL("content.html"), function(d) {
$("body").append(d);
crapi.clone(function(d) {
- Read upRead up
- Create a ticketCreate a ticket
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 getCursorPosition
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getCursorPosition : function() {
var element = input = this[0];
var value = (input.value || input.innerText)
if(!this.data("lastCursorPosition")){
- Create a ticketCreate a ticket
Function _generateAlerts
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _generateAlerts() {
//var watchlistAlerts = data['watchlist-queue'].length;
var alerts = feedAlerts;// + watchlistAlerts;
var alertString = "";
- Create a ticketCreate a ticket
Function refresh_watchlist
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function refresh_watchlist() {
var email = $('#email').val();
crapi.clone(function(d) {
var watchlist = d[email]["watchlist"] || {};
- Create a ticketCreate a ticket
Function initNav
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initNav() {
var $pageLinks = $("nav.main [data-page]");
var $tabGroups = $("nav.inner[data-page]");
var $contentGroups = $("main .inner[data-page]");
- Create a ticketCreate a ticket