Showing 5,378 of 5,715 total issues
Method path_to
has 493 lines of code (exceeds 25 allowed). Consider refactoring. Open
def path_to(page_name, *args) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
case page_name
# Public
when /the home\s?page/
File routes.rb
has 885 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'routing_constraints'
require 'prometheus_exporter_port'
# rubocop:disable Metrics/BlockLength
Method up
has 357 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.up
create_table "attachment_versions", :force => true do |t|
t.integer "attachment_id"
t.integer "version"
t.string "file_path"
Method down
has 339 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.down
change_column :account_group_memberships, :id, :integer
change_column :account_group_memberships, :account_id, :integer
change_column :account_group_memberships, :group_id, :integer
change_column :account_group_memberships, :tenant_id, :integer
Method up
has 339 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.up
change_column :account_group_memberships, :id, "bigint auto_increment"
change_column :account_group_memberships, :account_id, "bigint"
change_column :account_group_memberships, :group_id, "bigint"
change_column :account_group_memberships, :tenant_id, "bigint"
File 20120117134623_increase_ids_to64_bit.rb
has 684 lines of code (exceeds 250 allowed). Consider refactoring. Open
class IncreaseIdsTo64Bit < ActiveRecord::Migration
def self.up
change_column :account_group_memberships, :id, "bigint auto_increment"
change_column :account_group_memberships, :account_id, "bigint"
change_column :account_group_memberships, :group_id, "bigint"
File 20121018100514_removing_bcms_tables.rb
has 632 lines of code (exceeds 250 allowed). Consider refactoring. Open
class RemovingBcmsTables < ActiveRecord::Migration
def self.up
drop_table :account_group_memberships
drop_table :app_exhibits
drop_table :assets
Function Modernizr
has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring. Open
;window.Modernizr=function(a,b,c){function u(a){i.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}function z(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)o[c[d]]=c[d]in j;return o.list&&(o.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),o}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,g,h,i=a.length;d<i;d++)j.setAttribute("type",g=a[d]),e=j.type!=="text",e&&(j.value=k,j.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(g)&&j.style.WebkitAppearance!==c?(f.appendChild(j),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(j,null).WebkitAppearance!=="textfield"&&j.offsetHeight!==0,f.removeChild(j)):/^(search|tel)$/.test(g)||(/^(url|email)$/.test(g)?e=j.checkValidity&&j.checkValidity()===!1:e=j.value!=k)),n[a[d]]=!!e;return n}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j=b.createElement("input"),k=":)",l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e});for(var A in m)t(m,A)&&(r=A.toLowerCase(),e[r]=m[A](),p.push((e[r]?"":"no-")+r));return e.input||z(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),h=j=null,e._version=d,e}(this,this.document);
- 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
Class Service
has 64 methods (exceeds 20 allowed). Consider refactoring. Open
class Service < ApplicationRecord # rubocop:disable Metrics/ClassLength
include Searchable
include Backend::ModelExtensions::Service
include Logic::Contracting::Service
include Logic::PlanChanges::Service
Class User
has 63 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord
include Symbolize
include Fields::Fields
required_fields_are :username, :email
Class Proxy
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
class Proxy < ApplicationRecord # rubocop:disable Metrics/ClassLength
include AfterCommitQueue
include BackendApiLogic::ProxyExtension
prepend BackendApiLogic::RoutingPolicy
include GatewaySettings::ProxyExtension
Denial of Service Vulnerability in ActiveRecord’s PostgreSQL adapter Open
activerecord (6.0.6.1)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-44566
URL: https://github.com/rails/rails/releases/tag/v7.0.4.1
Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1
ReDoS based DoS vulnerability in Active Support’s underscore Open
activesupport (6.0.6.1)
- Read upRead up
- Exclude checks
Advisory: CVE-2023-22796
URL: https://github.com/rails/rails/releases/tag/v7.0.4.1
Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1
ReDoS based DoS vulnerability in Action Dispatch Open
actionpack (6.0.6.1)
- Read upRead up
- Exclude checks
Advisory: CVE-2023-22795
URL: https://github.com/rails/rails/releases/tag/v7.0.4.1
Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1
ReDoS based DoS vulnerability in Action Dispatch Open
actionpack (6.0.6.1)
- Read upRead up
- Exclude checks
Advisory: CVE-2023-22792
URL: https://github.com/rails/rails/releases/tag/v7.0.4.1
Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1
Authorization header leak on port redirect in mechanize Open
mechanize (2.7.7)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-31033
Criticality: Medium
URL: https://github.com/sparklemotion/mechanize/security/advisories/GHSA-64qm-hrgp-pgr9
Solution: upgrade to >= 2.8.5
File proxy.rb
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ipaddr'
require 'resolv'
class Proxy < ApplicationRecord # rubocop:disable Metrics/ClassLength
include AfterCommitQueue
File paths.rb
has 502 lines of code (exceeds 250 allowed). Consider refactoring. Open
World(Module.new do
break unless defined?(DeveloperPortal)
include System::UrlHelpers.cms_url_helpers
Class Invoice
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
class Invoice < ApplicationRecord
%I[due_on period issued_on last_charging_retry].each do |attr|
attribute attr, :date
end
Class Account
has 56 methods (exceeds 20 allowed). Consider refactoring. Open
class Account < ApplicationRecord
attribute :credit_card_expires_on, :date
self.ignored_columns = %i[proxy_configs_file_name proxy_configs_content_type proxy_configs_file_size
proxy_configs_updated_at proxy_configs_conf_file_name proxy_configs_conf_content_type
proxy_configs_conf_file_size proxy_configs_conf_updated_at]