Showing 566 of 915 total issues
Function getData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
getData: function(url, oembedLinks, options, cb) {
var href = oembedLinks[0].href;
var skip = false, self_endpoint = false;
- 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 makeMediaResponsive
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function makeMediaResponsive(link) {
if (!link.media) {
link.media = {};
}
- 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 generateLinksHtml
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.generateLinksHtml = function(data, options) {
// Links may be grouped.
var links = data.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 formatFile
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatFile(o, headers, req) {
if (typeof o !== 'object' ||
(typeof Blob !== 'undefined' && o instanceof Blob) ||
(typeof ArrayBuffer !== 'undefined' && o instanceof ArrayBuffer)) {
Function link
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(s, e, a, c){
var ref$, btntype, that;
if (!e.hasClass('ui')) {
e.addClass('btn');
}
Function h
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function h(e, r) {
if (k += e,
void 0 === r)
return D += f(),
0;
Function _handleDropDownSelection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _handleDropDownSelection(key) {
var processed = true;
switch (key) {
case KEY.DOWN:
if (!ctrl.open && ctrl.multiple) ctrl.activate(false, true); //In case its the search input in 'multiple' mode
Function year
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
year: function year(unixDate) {
var selectedDate = moment.utc(unixDate).startOf('year');
// View starts one year before the decade starts and ends one year after the decade ends
// i.e. passing in a date of 1/1/2013 will give a range of 2009 to 2020
// Truncate the last digit from the current year and subtract 1 to get the start of the decade
Function _onDragEnd
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onDragEnd: function(t) {
var e = this._map
, i = e.options
, n = +new Date - this._lastTime
, s = !i.inertia || n > i.inertiaThreshold || !this._positions[0];
Function removeEventListener
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
removeEventListener: function(t, e, i) {
if (!this[s])
return this;
if (!t)
return this.clearAllEventListeners();
Function loadLogs
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadLogs(sets, cb) {
var pluginTestsDict = _.object(pluginTests.map(function(p) { return [p._id, p]; }));
async.eachSeries(sets.filter(function(s) {return s;}), function(s, cb) {
Function fetchUrlsByPageOnFeed
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.fetchUrlsByPageOnFeed = function(pageWithFeed, otpions, cb) {
if (typeof options === "function") {
cb = options;
options = {};
Function _buildChildren
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _buildChildren(children, obj) {
var current = obj;
children.forEach(function(child) {
Function addListenersOnMap
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addListenersOnMap() {
window.map.on("zoomend", function(event) {
if (!prevZoomAction) {
prevZoomAction = new Date();
getMoreLocationOnMapAction();
Function _open
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _open(url, interactive) {
// Launch
var ref = {
closed: false
Function addListenersOnMap
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addListenersOnMap() {
window.map.on("zoomend", function(event) {
if (!prevZoomAction) {
prevZoomAction = new Date();
getMoreLocationOnMapAction();
Function minute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
minute: function minute(unixDate) {
var selectedDate = moment.utc(unixDate).startOf('hour');
var previousViewDate = moment.utc(selectedDate).startOf('day');
var activeFormat = ngModelController.$modelValue ? moment(ngModelController.$modelValue).format('YYYY-MM-DD H:mm') : '';
Function getNewActiveMatchIndex
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getNewActiveMatchIndex(){
switch(key){
case KEY.LEFT:
// Select previous/first item
if(~$selectMultiple.activeMatchIndex) return prev;
Function getData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getData: function(url, meta, whitelistRecord) {
if (!whitelistRecord.isDefault && ((meta.og && meta.og.image) || (meta.twitter && meta.twitter.image))) {return;}
if (url.match(/^https?:\/\/link\.brightcove\.(?:com|co\.jp)\/services\/player\/bcpid(\d+)\?/i)) {return;}
Function LoklakFieldService
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function LoklakFieldService() {
var service = {};
service.fieldList =