Showing 1,158 of 1,254 total issues
Method has too many lines. [14/10] Open
def new_event_record
OpenStruct.new(
addresses: [OpenStruct.new],
dates: [OpenStruct.new],
contacts: [OpenStruct.new],
- 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.
Cyclomatic complexity for perform is too high. [10/6] Open
def perform
@tour_data.each do |tour_data_line|
@waste_types.each do |waste_type_key, _waste_type|
next if @tour_assignment[waste_type_key].blank?
next if @address_assignment[waste_type_key].blank?
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
File waste_calendar_controller.rb
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "csv"
class WasteCalendarController < ApplicationController
before_action :verify_current_user
before_action { verify_current_user_role("role_waste_calendar") }
Function setObjKey
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsonform.util.setObjKey = function(obj,key,value) {
var innerobj = obj;
var keyparts = key.split(".");
var subkey = null;
var arrayMatch = null;
Function getNodeBoundaries
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getNodeBoundaries = function (node, initialNode) {
var schemaKey = null;
var arrayKey = null;
var boundaries = {
minItems: -1,
Function initializeTabs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initializeTabs = function (tabs) {
var activate = function (element, container) {
container
.find('> .active')
.removeClass('active');
Function generate
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
formNode.prototype.generate = function () {
var data = {
id: this.id,
keydash: this.keydash,
elt: this.formElement,
Method convert_params_for_graphql
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def convert_params_for_graphql
# Convert has_many contacts
if @job_params["contacts"].present?
contacts = []
@job_params["contacts"].each do |_key, contact|
Method has too many lines. [13/10] Open
def visibility_switch(item, item_class)
input_switch = check_box_tag(
"visible-#{item.id}",
item.visible ? 'freigegeben' : 'gesperrt',
item.visible,
- 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 update is too high. [18.41/15] Open
def update
static_content_name = params[:name]
static_content_version = params[:static_content][:version]
query = create_params
begin
- 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. [13/10] Open
def update
static_content_name = params[:name]
static_content_version = params[:static_content][:version]
query = create_params
begin
- 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. [13/10] Open
def index
results = @smart_village.query <<~GRAPHQL
query {
staticContents: publicHtmlFiles {
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. [13/10] Open
def update
auth_server = SmartVillageApi.auth_server_url
uri = Addressable::URI.parse("#{auth_server}/data_provider/update.json")
data_to_send = {
data_provider: data_provider_params,
- 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. [13/10] Open
def create
query = create_params
begin
results = @smart_village.query query
rescue Graphlient::Errors::GraphQLError => e
- 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. [13/10] Open
def load_deadline_category_list
latest = 9_999_999_999 # very high number to always match the latest version
results = @smart_village.query <<~GRAPHQL
query {
publicJsonFile(name: "globalSettings", version: "#{latest}") {
- 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.
Perceived complexity for verify_user is too high. [10/7] Open
def verify_user
result = validate_support_id
if result && result.code == "200" && result.body.present?
encounter_server = SmartVillageApi.encounter_server_url
uri = Addressable::URI.parse("#{encounter_server}/v1/support/verify_user.json")
- 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
Method has too many lines. [13/10] Open
def new_tour
OpenStruct.new(
addresses: [OpenStruct.new(
geo_location: OpenStruct.new
)],
- 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. [13/10] Open
def signed_url
bucket = @minio_config["bucket"]
headers = {}
options = { path_style: true }
- 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. [13/10] Open
def create
query = create_or_update_mutation
begin
results = @smart_village.query query
schedule_push_notifications_queries(results.data.create_generic_item.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.
Assignment Branch Condition size for show is too high. [18.11/15] Open
def show
result = validate_support_id
if result && result.code == "200" && result.body.present?
user_data = OpenStruct.new(JSON.parse(result.body))
- 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.