Showing 19 of 604 total issues
File hammer.js
has 1509 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */
Function getTouches
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getTouches(ev, type) {
var allTouches = toArray(ev.touches);
var targetIds = this.targetIds;
// when there is only one touch, the process can be simplified
Function process
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
process: function(input) {
var options = this.options;
var validPointers = input.pointers.length === options.pointers;
var validMovement = input.distance < options.threshold;
Function computeInputData
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function computeInputData(manager, input) {
var session = manager.session;
var pointers = input.pointers;
var pointersLength = pointers.length;
Method setup_library
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_library
library = Gallerist::Library.new settings.library_path
settings.set :library, library
logger.info "Loading library from \"#{library.path}\""
Method registered
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.registered(_)
configure do
set :logging, ENV['VERBOSE'] ? ::Logger::WARN : ::Logger::INFO
tempdir = Dir.mktmpdir('gallerist')
Function PEhandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler: function PEhandler(ev) {
var store = this.store;
var removePointer = false;
var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
Function preventDefaults
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
preventDefaults: function(input) {
var srcEvent = input.srcEvent;
var direction = input.offsetDirection;
// if the touch action did prevented once this session
Function recognize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
recognize: function(inputData) {
var session = this.session;
if (session.stopped) {
return;
}
Method setup_library
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def setup_library
library = Gallerist::Library.new settings.library_path
settings.set :library, library
logger.info "Loading library from \"#{library.path}\""
- 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 link_to
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def link_to(obj, classes = nil, link = nil)
classes = [ classes ].compact
link = obj.respond_to?(:name) ? obj.name : obj.id if link.nil?
classes = classes.empty? ? '' : ' class="%s"' % [ classes.join(' ') ]
- 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
Avoid deeply nested control flow statements. Open
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
Method call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
@app.call env
rescue Exception => error
if env['rack.warmup']
if defined?(SQLite3::BusyException) && error.is_a?(SQLite3::BusyException)
- 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 widget_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def widget_for(obj)
classes = %w{label label-primary}
case obj
when Gallerist::Person
- 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
Avoid too many return
statements within this function. Open
return TOUCH_ACTION_AUTO;
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return STATE_FAILED;
Avoid too many return
statements within this function. Open
return STATE_FAILED;