Showing 34 of 55 total issues
File jquery.atwho.js
has 709 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
//
/*
Implement Github like autocomplete mentions
http://ichord.github.com/At.js
File qrcode.js
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* @fileoverview
* - Using the 'QRCode for Javascript library'
* - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
* - this library has no dependencies.
Function ddscrollSpy
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.ddscrollSpy = function(options){
var $window = $(window)
var $body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
File jquery.html5-fileupload.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery HTML5 File Upload
*
* Author: timdream at gmail.com
* Web: http://timc.idv.tw/html5-file-upload/
Function handleFile
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var handleFile = function (settings, file) {
var info = {
// properties of standard File object || Gecko 1.9 properties
type: file.type || '', // MIME type
size: file.size || file.fileSize,
Function handleImage
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var handleImage = function (settings, dataurl, info) {
var img = new Image();
img.onerror = function () {
log('ERROR: <img> failed to load, file is not a supported image format.');
settings.fileError.call(this, info, 'FILE_NOT_IMAGE', 'File is not a supported image format.');
Function onload
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
img.onload = function () {
var ratio = Math.max(
img.width/settings.imageMaxWidth,
img.height/settings.imageMaxHeight,
1
Function handleForm
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var handleForm = function (settings, type, data, info) {
if (canSendFormData && type === 'file') {
// FormData API saves the day
log('INFO: Using FormData to construct form.');
var formdata = new FormData();
Consider simplifying this complex logical expression. Open
Open
this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}
Function exports
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(api) {
var validEnv = ['development', 'test', 'production']
var currentEnv = api.env()
var isDevelopmentEnv = api.env('development')
var isProductionEnv = api.env('production')
Function fileUpload
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.fileUpload = function(settings) {
this.each(function(i, el) {
if ($(el).is('input[type=file]')) {
log('INFO: binding onchange event to a input[type=file].');
$(el).bind(
Function spyonmenuitems
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function spyonmenuitems($menu){
var $menuitems = $menu.find('a[href^="#"]')
targets = []
curtarget = ''
totaltargetsheight = 0
Function highlightitem
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function highlightitem(){
if (targets.length == 0)
return
var prevtarget = curtarget
var scrolltop = $spytarget.scrollTop()
Function filter
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
Array.prototype.filter = function(fun /*, thisp */){
"use strict";
if (this == null)
throw new TypeError();
- 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 svgDrawer
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var svgDrawer = (function() {
var Drawing = function (el, htOption) {
this._el = el;
this._htOption = htOption;
Function draw
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Drawing.prototype.draw = function (oQRCode) {
var _elImage = this._elImage;
var _oContext = this._oContext;
var _htOption = this._htOption;
Function Drawing
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () {
var Drawing = function (el, htOption) {
this._el = el;
this._htOption = htOption;
};
Function on_keydown
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
App.prototype.on_keydown = function(e) {
var view, _ref;
view = (_ref = this.controller()) != null ? _ref.view : void 0;
if (!(view && view.visible())) {
return;
Function QR8bitByte
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function QR8bitByte(data) {
this.mode = QRMode.MODE_8BIT_BYTE;
this.data = data;
this.parsedData = [];
Function drawImage
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {