Showing 48 of 109 total issues
File context_messenger.js
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileOverview This script is responsible for integrating privly-applications,
* content scripts, the browser extension background script,
* and mobile architectures with message passing. Each of these scripting contexts
* include this script on each of the platforms (Chrome, Firefox, etc).
File seamless.js
has 471 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileOverview The seamless-posting adapter.
*
* This adapter is designed to be loaded in an seamless-posting iframe.
* It needs seamless-posting content scripts to work correctly.
File show.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileOverview This is a general adapter for interfacing with the Privly-web
* server: github.com/privly/privly-web
*
* Its purpose is to allow all privly-web derived applications to interface
Function contentReturned
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
contentReturned: function(response, callback) {
if( response.jqXHR.status === 200 ) {
var json = response.json;
Function pendingContent
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
pendingContent: function(callback) {
// Show prompt to download extension, if in the hosted environment
callbacks.showDownloadMessage();
File network_service.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileOverview Interfaces the application with its current architecture.
* This could be an extension, mobile app, or a hosted web server.
*
**/
Function getMessageDOM
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getMessageDOM(row) {
var href = row.privly_URL;
var app = row.privly_application;
// Rename deperecated apps - TODO Will be removed soon
Function get_link_creation_apps
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_link_creation_apps():
"""
Gets a list of the apps that will be included in the top navigation
for generating new links
"""
- Read upRead up
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 onConnectionCheckSucceeded
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
SeamlessAdapter.prototype.onConnectionCheckSucceeded = function () {
var self = this;
return self
.emitAsync('connectionCheckSucceeded')
.then(self.getTTLOptions.bind(self))
Function upgrade
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Privly.options.upgrade = function () {
// Privly posting button
var disableButton = ls.getItem('Options:DissableButton');
if (disableButton !== undefined) {
try {
Function contentReturned
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
contentReturned: function(response, callback) {
if( response.jqXHR.status === 200 ) {
var json = response.json;
- Read upRead up
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 tooltip
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
tooltip: function(){
// Create a new glyph if needed
if (Privly.options.getGlyph() === null) {
privlyTooltip.generateNewGlyph();
Function isWhitelistedDomain
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
isWhitelistedDomain: function(url) {
// Chrome maintains an explicit whitelist in local storage
if( privlyNetworkService.platformName() === "CHROME" ||
privlyNetworkService.platformName() === "FIREFOX") {
- Read upRead up
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 pendingContent
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
pendingContent: function(callback) {
// Show prompt to download extension, if in the hosted environment
callbacks.showDownloadMessage();
- Read upRead up
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 isDomainValid
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Privly.options.isDomainValid = function (domain) {
// Each subdomain can be from 1-63 characters and may contain alphanumeric
// characters, - and _ but may not begin or end with - or _
// Each domain can be from 1-63 characters and may contain alphanumeric
// characters and - but may not begin or end with - Each top level domain may
Function createLink
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
SeamlessAdapter.prototype.createLink = function () {
var self = this;
return self
.getRequestContent($('textarea').val())
.then(function (json) {
Function click
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
click: function(evt, callback) {
if( ! privlyNetworkService.permissions.canUpdate ) {
callbacks.singleClick(evt, callback);
return;
Function initMenu
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
SeamlessTTLSelectAdapter.prototype.initMenu = function (isAboveButton, selectedTTLValue, callback) {
$('#menu').empty();
this.getTTLOptions()
.then(function (options) {
var i;
Function getGlyphDOM
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Privly.glyph.getGlyphDOM = function (size) {
if (size === undefined) {
size = 30;
}
// Generate a new glyph if not exist
Function click
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
click: function(evt, callback) {
if( ! privlyNetworkService.permissions.canUpdate ) {
callbacks.singleClick(evt, callback);
return;
- Read upRead up
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"