Showing 1,158 of 1,254 total issues
Inefficient Regular Expression Complexity in Loofah Open
loofah (2.2.3)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-23514
Criticality: High
URL: https://github.com/flavorjones/loofah/security/advisories/GHSA-486f-hjj9-9vhh
Solution: upgrade to >= 2.19.1
Denial of Service in rubyzip ("zip bombs") Confirmed
rubyzip (1.2.4)
- Read upRead up
- Exclude checks
Advisory: CVE-2019-16892
Criticality: Medium
URL: https://github.com/rubyzip/rubyzip/pull/403
Solution: upgrade to >= 1.3.0
Inefficient Regular Expression Complexity in rails-html-sanitizer Open
rails-html-sanitizer (1.2.0)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-23517
Criticality: High
URL: https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-5x79-w82f-gw8w
Solution: upgrade to >= 1.4.4
Improper neutralization of data URIs may allow XSS in rails-html-sanitizer Open
rails-html-sanitizer (1.2.0)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-23518
Criticality: Medium
URL: https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m
Solution: upgrade to >= 1.4.4
Regular Expression Denial of Service in Addressable templates Open
addressable (2.6.0)
- Read upRead up
- Exclude checks
Advisory: CVE-2021-32740
Criticality: High
URL: https://github.com/advisories/GHSA-jxhc-q857-3j6g
Solution: upgrade to >= 2.8.0
Improper neutralization of data URIs may allow XSS in Loofah Open
loofah (2.2.3)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-23515
Criticality: Medium
URL: https://github.com/flavorjones/loofah/security/advisories/GHSA-228g-948r-83gx
Solution: upgrade to >= 2.19.1
Potential XSS vulnerability in jQuery Open
jquery-rails (4.3.3)
- Read upRead up
- Exclude checks
Advisory: CVE-2020-11023
Criticality: Medium
URL: https://blog.jquery.com/2020/04/10/jquery-3-5-0-released
Solution: upgrade to >= 4.4.0
Possible XSS vulnerability with certain configurations of rails-html-sanitizer Open
rails-html-sanitizer (1.2.0)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-23520
Criticality: Medium
URL: https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-rrfc-7g8p-99q8
Solution: upgrade to >= 1.4.4
Assignment Branch Condition size for index is too high. [71.2/15] Open
def index
if helpers.visible_in_role?("role_news_item")
news_results = @smart_village.query <<~GRAPHQL
query {
newsItems {
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.
Assignment Branch Condition size for set_defaults_and_types is too high. [66.29/15] Open
def set_defaults_and_types(entry)
# set default values
entry["color"] = entry["color"].presence || "#ffffff" if entry.keys.include?("color")
if entry.keys.include?("temperature")
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.
Method has too many lines. [60/10] Open
def edit
results = @smart_village.query <<~GRAPHQL
query {
genericItem(
id: #{params[:id]}
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Complex method ConstructionsController#convert_params_for_graphql (104.0) Open
def convert_params_for_graphql
# Convert has_many categories
if @construction_params["categories"].present?
categories = []
@construction_params["categories"].each do |_key, category|
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Method has too many lines. [57/10] Open
def convert_params_for_graphql
# Convert has_many categories
if @construction_params["categories"].present?
categories = []
@construction_params["categories"].each do |_key, category|
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [57/10] Open
def edit
results = @smart_village.query <<~GRAPHQL
query {
genericItem(
id: #{params[:id]}
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [57/10] Open
def edit_survey_record
results = @smart_village.query <<~GRAPHQL
query {
surveys(
ids: [
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for convert_params_for_graphql is too high. [59.95/15] Open
def convert_params_for_graphql
# Convert has_many contacts
if @job_params["contacts"].present?
contacts = []
@job_params["contacts"].each do |_key, contact|
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.
Method convert_params_for_graphql
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def convert_params_for_graphql
# Convert has_many content_blocks(which has_many media_contents)
content_block_params = @offer_params["content_blocks"]
return unless content_block_params.present?
- 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
Block has too many lines. [102/25] Open
@tour_params["tour_stops"].each do |_key, tour_stop|
next if tour_stop.blank?
next if tour_stop["name"].blank?
if tour_stop["payload"].present?
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Function buildFromLayout
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
formTree.prototype.buildFromLayout = function (formElement, context) {
var schemaElement = null;
var node = new formNode();
var view = null;
var key = null;
Perceived complexity for convert_params_for_graphql is too high. [49/7] Open
def convert_params_for_graphql
# Check recursively if any addresses data is given.
# If not, we do not want to submit the params, because the name is required by the model,
# which will result in a validation error.
if @tour_params["addresses"].present?
- Read upRead up
- Exclude checks
This cop tries to produce a complexity score that's a measure of the
complexity the reader experiences when looking at a method. For that
reason it considers when
nodes as something that doesn't add as much
complexity as an if
or a &&
. Except if it's one of those special
case
/when
constructs where there's no expression after case
. Then
the cop treats it as an if
/elsif
/elsif
... and lets all the when
nodes count. In contrast to the CyclomaticComplexity cop, this cop
considers else
nodes as adding complexity.
Example:
def my_method # 1
if cond # 1
case var # 2 (0.8 + 4 * 0.2, rounded)
when 1 then func_one
when 2 then func_two
when 3 then func_three
when 4..10 then func_other
end
else # 1
do_something until a && b # 2
end # ===
end # 7 complexity points