Showing 20 of 24 total issues
Function dropdown
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.dropdown = function (options) {
var defaults = {
inDuration: 300,
outDuration: 225,
constrain_width: false, // Does not change width of dropdown to that of the activator
Method import_events
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def import_events
puts "Importing events"
Geocoder.configure(lookup: :yandex)
use_old_db
- 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 placeDropdown
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function placeDropdown(eventType) {
// Check for simultaneous focus and click events.
if (eventType === 'focus') {
isFocused = true;
}
Function imageImport
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var imageImport = (function () {
// Import image to Canvas when $setImage input changed
var importImage = function ($croppedModalImage, $imageInput, $modal) {
var files = $imageInput[0].files;
var file;
- 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 import_events
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_events
puts "Importing events"
Geocoder.configure(lookup: :yandex)
use_old_db
Function autocomplete
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.autocomplete = function (options) {
var $container,
_data = [],
self = this.filter('input');
Function imageImport
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var imageImport = (function () {
// Import image to Canvas when $setImage input changed
var importImage = function ($croppedModalImage, $imageInput, $modal) {
var files = $imageInput[0].files;
var file;
Function bindGeocoder
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindGeocoder() {
function addressValue() {
return $placeAddress.val();
}
Function cropper
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var cropper = (function () {
var createCropper = function ($croppedModalImage, $currentImage, $form, onCropperCreated) {
$croppedModalImage.cropper({
background: false,
Method all_providers
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def all_providers
{
facebook: {
name: t("socials.facebook"),
class: "fa fa-facebook",
Method import_social_accounts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def import_social_accounts
puts "Importing social accounts"
use_old_db
social_accounts = ActiveRecord::Base.connection.execute("SELECT * FROM authentications")
- 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 initCropper
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
initCropper: function($croppedModalImage, $imageInput, $modal, $uploadImage, $imageForm, $currentImage) {
Method build_permalink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_permalink
target_field_value = send(permalink_configuration[:target_field])
return if permalink.present? || target_field_value.blank?
permalink_base = I18n.transliterate(target_field_value).parameterize.downcase
- 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 easeOutQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutQuad: function (x, t, b, c, d) {
Function easeOutCubic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutCubic: function (x, t, b, c, d) {
Function easeOutSine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutSine: function (x, t, b, c, d) {
Function swing
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
swing: function (x, t, b, c, d) {
Method load_photos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_photos(_tag)
photos ||= InstagramCache.get(_tag)
if photos.blank?
photos = load_from_instagram(_tag)
InstagramCache.store(_tag, photos) unless photos.blank?
- 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 create_user_from_omniauth
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_user_from_omniauth(_kind)
auth = request.env["omniauth.auth"]
@user = User.from_omniauth!(auth)
- 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 showImageOnLoad
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function showImageOnLoad($imageInput, $image, onLoadCallback) {
if (!$imageInput) {
return;
}
- 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"