Showing 13 of 19 total issues
Function generateTOC
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateTOC() {
if ($('#filecontents').length === 0) return;
var _toc = $('<ol class="top"></ol>');
var show = false;
var toc = _toc;
Function searchItem
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function searchItem() {
for (var i = 0; i < searchCache.length / 50; i++) {
var item = searchCache[searchIndex];
var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name);
var matchString = regexSearchString;
- 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 fullListSearch
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fullListSearch() {
// generate cache
searchCache = [];
$('#full_list li').each(function() {
var link = $(this).find('.object_link a');
Function summaryToggle
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function summaryToggle() {
$('.summary_toggle').click(function() {
if (localStorage) {
localStorage.summaryCollapsed = $(this).text();
}
Method format_value
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def format_value(value, modifier = nil, precision = 3)
rounded = round_float(value.scalar.to_f, precision)
if modifier != :raw then
format = "%0.#{precision}f"
- 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_filtering
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def perform_filtering(query)
rv = []
interface_filter ||= query.empty? ? /.+/ : /#{query}/i
execute_command("/usr/sbin/networksetup", "-listnetworkserviceorder").split(/\n\n/).each do |i|
- 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 format_forecast
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def format_forecast(place, image, link, current, forecast, wind, temperature_unit, speed_unit)
Method process_results
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_results(results)
results.map do |result|
title = "#{result[:connected] ? "Disconnect from" : "Connect to"} #{result[:name]}"
subtitle = "Action this item to #{result[:connected] ? "disconnect from" : "connect to"} the VPN service."
arg = "#{result[:connected] ? "disconnect" : "connect"} service \"#{result[:name]}\""
- 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 get_interfaces_names
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_interfaces_names
rv = {"lo0" => "Loopback"}
names = execute_command("/usr/sbin/networksetup", "-listallhardwareports").split(/\n\n/)
names.shift # Discard first whitespace
- 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 get_local_addresses
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_local_addresses
rv = []
names = get_interfaces_names
# Split by interfaces
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def handle_request(type, args)
# Enqueue the request. This will wait to avoid too many requests.
Server.enqueue_request
# Execute the request, if none were added.
- 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_filtering
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform_filtering(value, from, to, with_rate, multiple)
Method perform_filtering
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform_filtering(query)
@interface_filter ||= query.empty? ? /.*/ : /#{query}/i
# Get local addresses
rv = get_local_addresses
- 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"