Showing 141 of 177 total issues
Method extract_xml
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def extract_xml(doc)
extract_each { |extraction_details, values|
case
when css = extraction_details['css']
nodes = doc.css(css)
Function renderGraph
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
window.renderGraph = function ($chart, data, peaks, name) {
const graph = new Rickshaw.Graph({
element: $chart.find(".chart").get(0),
width: 700,
height: 240,
Method model
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def model(which_day)
value = pirate_weather[which_day - 1]
if value
timestamp = Time.at(value.time)
{
File feedjira_extension.rb
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'feedjira'
require 'digest'
require 'mail'
module FeedjiraExtension
Method validate_matchers
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def validate_matchers
matchers = options['matchers'] or return
unless matchers.is_a?(Array)
errors.add(:base, "matchers must be an array if 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
Function body
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
body: (body) => {
let previous;
const form = $(body).find(".dry-run-form");
const payload_editor = form.find(".payload-editor");
Method receive_web_request
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def receive_web_request(request)
# check the secret
secret = request.path_parameters[:secret]
return ["Not Authorized", 401] unless secret == interpolated['secret']
Method get_issues
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_issues(since)
startAt = 0
issues = []
# JQL doesn't have an ability to specify timezones
- 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 validate_options
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def validate_options
# Check for required fields
errors.add(:base,
"either url, url_from_event, or data_from_event are required") unless options['url'].present? || options['url_from_event'].present? || options['data_from_event'].present?
errors.add(:base,
- 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 handleTypeChange
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleTypeChange(firstTime) {
$(".event-descriptions").html("").hide();
const type = $("#agent_type").val();
if (type === "Agent") {
Method validate_location
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def validate_location
errors.add(:base, "location is required") unless location.present?
if location =~ VALID_COORDS_REGEX
lat, lon = coordinates
errors.add :base, "too low of a latitude" unless lat > -90
- 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 handle_request
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def handle_request
user = User.find_by_id(params[:user_id])
if user
agent = user.agents.find_by_id(params[:agent_id])
if agent
- 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 serialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def serialize(incoming_events)
mo = interpolated(incoming_events.first)
rows = rows_from_events(incoming_events, mo)
csv = CSV.generate(col_sep: separator(mo), force_quotes: true) do |csv|
if boolify(mo['with_header']) && rows.first.is_a?(Hash)
- 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 receive
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def receive(incoming_events)
max_keys = max_keys()
incoming_events.each do |event|
interpolate_with(event) do
- 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 receive
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def receive(incoming_events)
incoming_events.each do |event|
interpolate_with(event) do
post_params = {}
Method import
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import(options = {})
success = true
guid = parsed_data['guid']
description = parsed_data['description']
name = parsed_data['name']
Method validate_options
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_options
# Check for required fields
begin
if !options['url'].include?('{{')
url = interpolated['url']
Method control!
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def control!
control_targets.each do |target|
interpolate_with('target' => target) do
case action = control_action
when 'run'
Method receive
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def receive(incoming_events)
interpolate_with_each(incoming_events) do |event|
existing_payload = interpolated['mode'].to_s == "merge" ? event.payload : {}
if data_from_event = options['data_from_event'].presence
- 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 schedule_scheduler_agent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def schedule_scheduler_agent(agent)
job = scheduler_agent_job(agent)
if agent.unavailable?
if job
- 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"