Showing 1,031 of 1,643 total issues
Function print
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function print() {
loadEvents();
var dWeekDayOfMonthStart = new Date(dYear, dMonth, 1).getDay() - settings.firstDayOfWeek;
if (dWeekDayOfMonthStart < 0) {
dWeekDayOfMonthStart = 6 - ((dWeekDayOfMonthStart + 1) * -1);
File boxes_helper.rb
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
module BoxesHelper
include SanitizeHelper
include ActionView::Helpers::OutputSafetyHelper
def insert_boxes(content)
Function matchRecursive
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
XRegExp.matchRecursive = function (str, left, right, flags, options) {
var options = options || {},
escapeChar = options.escapeChar,
vN = options.valueNames,
flags = flags || "",
Function click
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
click: function (event) {
if (toggle_edit.target.isToggleIgnore(event.target))
return true;
var value_row = toggle_edit.value_row.locate(event.target);
- 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 _move
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function _move($id, $ref_id, $position = 0, $is_copy = false) {
if((int)$ref_id === 0 || (int)$id === 1) { return false; }
$sql = array(); // Queries executed at the end
$node = $this->_get_node($id); // Node data
$nchildren = $this->_get_children($id); // Node children
- 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 filter_by_facets
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def filter_by_facets(scope, facets)
queries = []
facets.each do |term, values|
kind, klass = term.split("-")
if kind == "attribute" || kind == "relation" || kind == "metadata"
- 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 presence_of_required_fields
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def presence_of_required_fields
self.required_fields.each do |field|
opts = REQUIRED_FIELDS_EXCEPTIONS[field.to_sym] || {}
if (opts[:cond] ? opts[:cond].call(self) : self.send(field).blank?)
unless opts[:unless].try(:call, self)
- 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 approved_themes
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def approved_themes(owner)
Dir.glob(File.join(system_themes_dir, "*")).map do |item|
next unless File.exists? File.join(item, "theme.yml")
id = File.basename item
- 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 add
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
handleObjIn, handlers, special;
Class Environment
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class Environment
settings_items :ldap_plugin, type: :hash, default: {}
validates_presence_of :ldap_plugin_host, if: lambda { |env| !env.ldap_plugin.blank? }
Class UploadedFile
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class UploadedFile < Article
include UploadSanitizer
include CroppedImage
attr_accessible :uploaded_data, :title
Class ApproveArticle
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class ApproveArticle < Task
validates_presence_of :requestor_id, :target_id
validates :requestor, kind_of: { kind: Person }
validate :allowed_requestor
Class ProfileEditorController
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class ProfileEditorController < MyProfileController
protect "edit_profile", :profile, except: [:destroy_profile]
protect "destroy_profile", :profile, only: [:destroy_profile]
skip_before_action :verify_authenticity_token, only: [:google_map]
Function keydown
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
, keydown: function (e) {
if (!this.focused) return
var _self = this
Method create
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
begin
@page = profile.articles.find(params[:id])
rescue
@page = nil
Function matcherFromGroupMatchers
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
Method quantity_price_data
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def quantity_price_data(actor_name)
data = { flags: {} }
statuses = ::OrdersPlugin::Order::Statuses
statuses_data = data[:statuses] = {}
Function createInfoBoxDiv_
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
InfoBox.prototype.createInfoBoxDiv_ = function () {
var bw;
var me = this;
- 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 facets_find_options
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def facets_find_options(facets_selected = {}, options = {})
browses = []
facets_selected ||= {}
facets_selected.map do |id, value|
next unless facets[id.to_sym]
- 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 solr_options
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def solr_options(asset, category)
asset_class = asset_class(asset)
solr_options = {}
if !multiple_search?
if !results_only? && asset_class.respond_to?(:facets)
- 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"