Showing 544 of 841 total issues
Function rgb2hsl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function rgb2hsl(rgb) {
var r = rgb[0]/255,
g = rgb[1]/255,
b = rgb[2]/255,
min = Math.min(r, g, b),
Function updateAttrs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateAttrs (oldVnode, vnode) {
if (!oldVnode.data.attrs && !vnode.data.attrs) {
return
}
var key, cur, old;
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(Chart) {
var helpers = Chart.helpers;
Chart.scaleService = {
Function renderScatterChart
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.renderScatterChart = function (chart) {
var options = jsOptions(chart, chart.options);
var colors = chart.options.colors || defaultColors;
Function refresh
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ScrollSpy.prototype.refresh = function () {
var that = this
var offsetMethod = 'offset'
var offsetBase = 0
Function next
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
Function preventBackspaceNav
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function preventBackspaceNav() {
$(document).keydown(function (e) {
var preventKeyPress
if (e.keyCode == 8) {
var d = e.srcElement || e.target
Function hide
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Collapse.prototype.hide = function () {
if (this.transitioning || !this.$element.hasClass('in')) return
var startEvent = $.Event('hide.bs.collapse')
this.$element.trigger(startEvent)
Function search
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Sifter.prototype.search = function(query, options) {
var self = this, value, score, search, calculateScore;
var fn_sort;
var fn_score;
Consider simplifying this complex logical expression. Open
Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
Function VNode
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
tag,
data,
children,
text,
elm,
Consider simplifying this complex logical expression. Open
Open
else if (floating) {
after = (target.previousElementSibling === dragEl) && !isWide || halfway && isWide;
} else {
after = (nextSibling !== dragEl) && !isLong || halfway && isLong;
}
Consider simplifying this complex logical expression. Open
Open
if (
(tag === '>*' && el.parentNode === ctx) || (
(tag === '' || el.nodeName.toUpperCase() == tag) &&
(!selector.length || ((' ' + el.className + ' ').match(re) || []).length == selector.length)
)
Consider simplifying this complex logical expression. Open
Open
if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month &&
(this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
&&
(this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
) {
Consider simplifying this complex logical expression. Open
Open
if (m._isValid == null) {
m._isValid = !isNaN(m._d.getTime()) &&
m._pf.overflow < 0 &&
!m._pf.empty &&
!m._pf.invalidMonth &&
Consider simplifying this complex logical expression. Open
Open
if (!HighchartsAdapter && "Highcharts" in window) {
HighchartsAdapter = new function () {
var Highcharts = window.Highcharts;
this.name = "highcharts";
Function jsOptionsFunc
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function jsOptionsFunc(defaultOptions, hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle) {
Consider simplifying this complex logical expression. Open
Open
if (detectType) {
value = new Date(toFloat(i));
// TODO make this efficient
day = day && isDay(value);
if (!dayOfWeek) {
Function fuzzysearch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
function fuzzysearch (needle, haystack) {
var hlen = haystack.length;
var nlen = needle.length;
if (nlen > hlen) {
return 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
Method blazer_format_value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def blazer_format_value(key, value)
if value.is_a?(Integer) && !key.to_s.end_with?("id") && !key.to_s.start_with?("id")
number_with_delimiter(value)
elsif value =~ BLAZER_URL_REGEX
# see if image or link
- 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"