Showing 8 of 12 total issues
Function barGraph
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
function barGraph(selector, url, metric) {
// Add the chart
d3.json(url, function(data) {
data = data.map(function(d, i) {
Class Tailwind
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Tailwind < ActionView::Helpers::FormBuilder
extend T::Sig
sig { params(method: Symbol, text: T.any(T.nilable(String), T::Hash[Symbol, String]), options: T::Hash[Symbol, String]).returns(String) }
def label(method, text = nil, options = {})
Method initialize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(size:, alignment:)
super
# Doing it this way so that tailwind doesn't compile the classes out
case size
Method initialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def initialize(tag:, size: nil, color: nil, font: nil, weight: nil, extra_classes: "")
super
default_size = DEFAULT_SIZES[tag]
raise "Unexpected tag #{tag}" if default_size.nil?
- 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 initialiseGeocodingMap
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function initialiseGeocodingMap(map_div) {
const { Map, InfoWindow } = await google.maps.importLibrary('maps');
const { Marker } = await google.maps.importLibrary("marker");
var g = JSON.parse(map_div.dataset.google);
Method initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(size:, alignment:)
super
# Doing it this way so that tailwind doesn't compile the classes out
case size
- 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 getAddress
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function getAddress() {
try {
var pos = await getPositionByGeolocation({enableHighAccuracy: true, timeout: 10000});
} catch(err) {
if (err.code == 1) { // User said no
- 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 changed_data_attributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def changed_data_attributes
v = previous_version
if v
changed = {}
data_attributes.each_key do |a|
- 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"