Showing 371 of 658 total issues
Function _createWidget
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
Function _makeDraggable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_makeDraggable: function() {
var that = this,
options = this.options;
function filteredUi( ui ) {
Function finish
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {
Function looseParse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var looseParse = function(f,s,o){
try{
var d = new Date('2012-01-01 '+ s);
if(isNaN(d.getTime())){
d = new Date('2012-01-01T'+ s);
Function caret
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
caret: function(begin, end) {
var range;
if (this.length === 0 || this.is(":hidden")) {
return;
Method to_csv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def to_csv(access_code = false, print_header = true)
result = Surveyor::Common.csv_impl.generate do |csv|
if print_header
csv << (access_code ? ["response set access code"] : []) +
csv_question_columns.map{|qcol| "question.#{qcol}"} +
- 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 parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse(str, filename)
csvlib = Surveyor::Common.csv_impl
begin
csvlib.parse(str, :headers => :first_row, :return_headers => true, :header_converters => :symbol) do |r|
if r.header_row? # header row
- 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 _setupHeightStyle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_setupHeightStyle: function( heightStyle ) {
var maxHeight,
parent = this.element.parent();
if ( heightStyle === "fill" ) {
Function _updateVirtualBoundaries
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_updateVirtualBoundaries: function(forceAspectRatio) {
var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
o = this.options;
b = {
Function left
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
Function top
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
Function stop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stop: function( event ) {
var that = $(this).data("ui-resizable"),
o = that.options,
pr = that._proportionallyResizeElements,
ista = pr.length && (/textarea/i).test(pr[0].nodeName),
Function getDimensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
Function refresh
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
refresh: function() {
//See #8237 & #8828
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
if ( isDisabled !== this.options.disabled ) {
Function _createPlaceholder
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createPlaceholder: function(that) {
that = that || this;
var className,
o = that.options;
Function setup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setup: function() {
if ( rformElems.test( this.nodeName ) ) {
// IE doesn't fire change on a check/radio until blur; trigger it on click
// after a propertychange. Eat the blur-change in special.change.handle.
Function propFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function propFilter( props, specialEasing ) {
var index, name, easing, value, hooks;
// camelCase, specialEasing and expand cssHook pass
for ( index in props ) {
Function _parseTime
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_parseTime: function(timeString, withDate) {
if (!this.inst) {
this.inst = $.datepicker._getInst(this.$input[0]);
}
Function set
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
set: function( elem, value ) {
var parsed, curElem,
backgroundColor = "";
if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
Function resize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
resize: function (event, ui) {
var that = $(this).data("ui-resizable"),
o = that.options,
os = that.originalSize,
op = that.originalPosition,