Showing 9 of 11 total issues
Function hookupSteps
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
app.hookupSteps = function() {
$('.startButton').on('click', function() {
app.scrollToElement($('#step1'));
});
File scripts.js
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
$(document).ready(function() {
app.hookupMap();
app.hookupSteps();
app.hideSteps();
});
Function geolocate
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
app.geolocate = function(e) {
e && e.preventDefault();
var address = $('#geolocate').val();
if (! address) { return }
var city = undefined;
Function hookupSteps
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
app.hookupSteps = function() {
$('.startButton').on('click', function() {
app.scrollToElement($('#step1'));
});
- 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 hookupMap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
app.hookupMap = function() {
document.getElementById('locatormap').innerHTML = "<div id='map'><div class='map-key-panel js-dot-legend'><span class='map-event-dot'></span>Click to see notification</div></div>";
var center = JSON.parse($('meta[name=mapCenter]').attr('content'));
var options = {
zoom: 13,
Function hookupMap
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
app.hookupMap = function() {
document.getElementById('locatormap').innerHTML = "<div id='map'><div class='map-key-panel js-dot-legend'><span class='map-event-dot'></span>Click to see notification</div></div>";
var center = JSON.parse($('meta[name=mapCenter]').attr('content'));
var options = {
zoom: 13,
- 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 geocode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
app.geocode = function(address, city, state, callback, context) {
Method call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def call(name, starts, ends, _, env)
Method perform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform(subscription_id)
subscription = Subscription.first!(id: subscription_id)
publisher = subscription.publisher
# TODO: get rid of this case statement
- 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"