Showing 177 of 262 total issues
File qr.js
has 808 lines of code (exceeds 250 allowed). Consider refactoring. Open
// [qr.js](http://neocotic.com/qr.js)
// (c) 2013 Alasdair Mercer
// Freely distributable under the MIT license.
// Based on [jsqrencode](http://code.google.com/p/jsqrencode/)
// (c) 2010 tz@execpc.com
- Create a ticketCreate a ticket
Function exports
has 370 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
'use strict';
/**
* GRUNT CONFIG
**/
- Create a ticketCreate a ticket
Function generateFrame
has 277 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateFrame(str) {
var i, j, k, m, t, v, x, y;
// Find the smallest version that fits the string.
t = str.length;
- Create a ticketCreate a ticket
Function saveAs
has 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
(function (view) {
'use strict';
var doc = view.document,
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
get_URL = function () {
- Create a ticketCreate a ticket
Function saveAs
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
(function (view) {
'use strict';
var doc = view.document,
// only get URL when necessary in case BlobBuilder.js hasn't overridden it yet
get_URL = function () {
- 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 onMessage
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
Module.prototype.onMessage = function (flow, message) {
if (this.failed && message.to) {
// We've attempted to load the module and failed, so short-circuit any
// messages bound for the provider, and respond with an error reply instead.
// This error is handled in Consumer, resulting in triggering the
- 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
File Gruntfile.js
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint node:true*/
/**
* Gruntfile for freedom.js
*
* Here are the common tasks used:
- Create a ticketCreate a ticket
Function getProvider
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
Provider.prototype.getProvider = function (source, identifier, args) {
if (!this.providerCls) {
this.debug.error('Cannot instantiate provider, since it is not provided');
return {instance: undefined, onmsg: undefined};
}
- 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 conform
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
Consumer.conform = function (template, from, externals, separate, debug) {
/* jshint -W086 */
if (typeof (from) === 'function' && template !== 'proxy') {
//from = undefined;
//throw "Trying to conform a function";
- 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
File module.js
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint indent:2,node:true,sloppy:true */
var util = require('./util');
var Provider = require('./provider');
/**
- Create a ticketCreate a ticket
File core.peerconnection.js
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*globals console, RTCPeerConnection, webkitRTCPeerConnection */
/*globals mozRTCPeerConnection, RTCSessionDescription, RTCIceCandidate */
/*globals mozRTCSessionDescription, mozRTCIceCandidate */
/*globals ArrayBuffer, Blob */
/*jslint indent:2,sloppy:true,node:true */
- Create a ticketCreate a ticket
Function getProvider
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Provider.prototype.getProvider = function (source, identifier, args) {
if (!this.providerCls) {
this.debug.error('Cannot instantiate provider, since it is not provided');
return {instance: undefined, onmsg: undefined};
}
- Create a ticketCreate a ticket
Function FileSaver
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
FileSaver = function (blob, name) {
// First try a.download, then web filesystem, then object URLs
var filesaver = this,
type = blob.type,
blob_changed = false,
- Create a ticketCreate a ticket
Function ApiInterface
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ApiInterface = function(def, onMsg, emit, debug) {
var inflight = {},
events = null,
emitter = null,
reqId = 0,
- Create a ticketCreate a ticket
Function handleEvents
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
util.handleEvents = function(obj) {
var eventState = {
DEBUG_BACKREF: obj,
multiple: {},
maybemultiple: [],
- 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 setup
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setup = function (context, manifest, config) {
'use strict';
var debug = new Debug(),
hub = new Hub(debug),
resource = new Resource(debug),
- Create a ticketCreate a ticket
File moduleinternal.js
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jslint indent:2, node:true,sloppy:true */
var PromiseCompat = require('es6-promise').Promise;
var ApiInterface = require('./proxy/apiInterface');
var Provider = require('./provider');
- Create a ticketCreate a ticket
Function onMessage
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Provider.prototype.onMessage = function (source, message) {
if (source === 'control' && message.reverse) {
this.channels[message.name] = message.channel;
this.emit(message.channel, {
type: 'channel announcement',
- 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 emitMessage
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Module.prototype.emitMessage = function (name, message) {
if (this.internalPortMap[name] === false && message.channel) {
this.internalPortMap[name] = message.channel;
this.emit('internalChannelReady');
return;
- 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 onMessage
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Module.prototype.onMessage = function (flow, message) {
if (this.failed && message.to) {
// We've attempted to load the module and failed, so short-circuit any
// messages bound for the provider, and respond with an error reply instead.
// This error is handled in Consumer, resulting in triggering the
- Create a ticketCreate a ticket