Showing 1,031 of 1,643 total issues
Method _reconstruct
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _reconstruct() {
$this->db->query("" .
"CREATE TEMPORARY TABLE `temp_tree` (" .
"`".$this->fields["id"]."` INTEGER NOT NULL, " .
"`".$this->fields["parent_id"]."` INTEGER NOT NULL, " .
File entities.rb
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Api
module Entities
PERMISSIONS = {
admin: 0,
self: 10,
Function pjax
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pjax(options) {
options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)
if ($.isFunction(options.url)) {
options.url = options.url()
Class PgSearchPlugin
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class PgSearchPlugin < Noosfero::Plugin
include SearchHelper
def self.plugin_name
"Postgres Full-Text Search"
Function load_node_html
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
load_node_html : function (obj, s_call, e_call) {
var d,
s = this.get_settings().html_data,
error_func = function () {},
success_func = function () {};
Class Order
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class OrdersPlugin::Order < ApplicationRecord
# if abstract_class is true then it will trigger https://github.com/rails/rails/issues/20871
# self.abstract_class = true
Statuses = ::OrdersPlugin::Item::Statuses
Class Comment
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Comment < ApplicationRecord
include Notifiable
SEARCHABLE_FIELDS = {
title: { label: _("Title"), weight: 10 },
Class Theme
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Theme
class << self
def system_themes
Dir.glob(File.join(system_themes_dir, "*")).map do |path|
config_file = File.join(path, "theme.yml")
Class AccountController
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class AccountController < ApplicationController
no_design_blocks
before_action :login_required, :require_login_for_environment, only: [:activation_question, :accept_terms, :activate_enterprise, :change_password]
before_action :redirect_if_logged_in, only: [:login, :signup, :activate]
Function Tokenfield
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Tokenfield = function (element, options) {
var _self = this
this.$element = $(element)
this.textDirection = this.$element.css('direction');
Class Cycle
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class OrdersCyclePlugin::Cycle < ApplicationRecord
attr_accessible :profile, :status, :name, :description, :opening_message
attr_accessible :start, :finish, :delivery_start, :delivery_finish
attr_accessible :start_date, :start_time, :finish_date, :finish_time, :delivery_start_date, :delivery_start_time, :delivery_finish_date, :delivery_finish_time,
File sniffer.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
sniffer = {
search: {
filters: { __categoryIds: [], distance: 0, circle: undefined, homePosition: undefined },
Function load_node_json
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
load_node_json : function (obj, s_call, e_call) {
var s = this.get_settings().json_data, d,
error_func = function () {},
success_func = function () {};
obj = this._get_node(obj);
Function cookie
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
- 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 report_orders_by_consumer
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def report_orders_by_consumer(orders)
p = Axlsx::Package.new
wb = p.workbook
# create styles
- 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 vote_partial
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def vote_partial(target, like = true, load_voters = false)
vote = like ? 1 : -1
like_action = like ? "like" : "dislike"
type = target.kind_of?(Article) ? "article" : target.kind_of?(Comment) ? "comment" : nil
- 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 invite
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def self.invite(person, contacts_to_invite, message, profile)
contacts_to_invite.each do |contact_to_invite|
next if contact_to_invite == _("Firstname Lastname <friend@email.com>")
contact_to_invite = contact_to_invite.to_s.strip
- 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 extra_blocks
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def extra_blocks(params = {})
return [] if self.class.extra_blocks.nil?
blocks = self.class.extra_blocks.map do |block, options|
type = options[:type]
- 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 date_field
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
def date_field(name, value, datepicker_options = {}, html_options = {})
datepicker_options[:disabled] ||= false
datepicker_options[:alt_field] ||= ""
datepicker_options[:alt_format] ||= ""
datepicker_options[:append_text] ||= ""
File shopping_cart_plugin_controller.rb
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "base64"
class ShoppingCartPluginController < OrdersPluginController
include ShoppingCartPlugin::CartHelper
helper ShoppingCartPlugin::CartHelper