Showing 151 of 266 total issues
Method create_single_number_chart
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_single_number_chart(results, name, multiplier, series_name, y_axis_label, **kwargs)
Method options_from_collection_for_select_with_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def options_from_collection_for_select_with_data(collection, value_method, text_method, selected = nil, data = {})
Function processAnalysisOperations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function processAnalysisOperations(chartConfig, chart, operations, drilldownAvailable, parentTimescaleDescription){
Method create!
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create!(meter_id, attribute_type, input_data, reason, user)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(school, alert_report, alert_generation_run, alert_type, asof_date)
Method create_multi_chart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_multi_chart(results, names, multiplier, y_axis_label, **kwargs)
Function setUpDatePicker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function setUpDatePicker(divId, inputId, maxMin, defaultDate, period) {
Method format_body
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def format_body(email, tags, interests, merge_fields, status = 'subscribed')
Method resource_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def resource_data(name, slug, project_id, categories, priority)
Method historic_solar_pv_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def historic_solar_pv_data(gsp_id, sunrise_sunset_latitude, sunrise_sunset_longitude, start_date, end_date)
Method historic_month
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def historic_month(system_id, from_month, from_year, to_month, to_year)
Method translated_series_item_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def translated_series_item_for(series_key_as_string)
series_key_as_string = series_key_as_string.to_s
return I18n.t('analytics.series_data_manager.series_name.baseload') if series_key_as_string.casecmp('baseload').zero?
return I18n.t('advice_pages.benchmarks.benchmark_school') if series_key_as_string == 'benchmark'
return I18n.t('advice_pages.benchmarks.exemplar_school') if series_key_as_string == 'exemplar'
- 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 determine_target_start_date
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def determine_target_start_date
return most_recent_target.target_date if most_recent_target.present?
target_start_date = default_target_start_date
[:electricity, :gas, :storage_heater].each do |fuel_type|
service = target_service(aggregate_school, fuel_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 same_prices?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def same_prices?
if @energy_tariff.flat_rate?
@energy_tariff.energy_tariff_prices.first.value == @current_n3rgy_tariff[:flat_rate]
elsif @energy_tariff.energy_tariff_prices.count == @current_n3rgy_tariff[:differential].values
@current_n3rgy_tariff[:differential].each_value do |period|
- 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 benchmark
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.benchmark(compare: :benchmark_school, fuel_type:)
case compare
when :benchmark_school
if fuel_type == :electricity
BenchmarkMetrics::BENCHMARK_OUT_OF_HOURS_USE_PERCENT_ELECTRICITY
- 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 send
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def send
unless @school.has_school_onboarding_event?(:data_enabled_email_sent)
users = @school.activation_users
if users.any?
target_prompt = include_target_prompt_in_email?
- 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 processAnnotations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function processAnnotations(loaded_annotations, chart){
var xAxis = chart.xAxis[0];
var xAxisCategories = xAxis.categories;
var annotations = loaded_annotations.map(function(annotation){
- 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 current_scores
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def current_scores
redirect_to school_group_path(@school_group) and return unless @school_group.scorable?
setup_scores_and_years(@school_group)
respond_to do |format|
- 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 colours_for_multiple_fuel_type_benchmark
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def colours_for_multiple_fuel_type_benchmark(data_type, category)
case data_type
when translated_series_item_for('Gas')
if benchmark_school_category?(category)
Colours.chart_gas_middle
- 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 perform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def perform
ext = File.extname(path_and_file_name)
content =
if %w(.xlsx .xls).include?(ext)
- 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"