codeforamerica/ohana-web-search

View on GitHub

Showing 9 of 2,141 total issues

Function FeedbackForm has a Cognitive Complexity of 16 (exceeds 6 allowed). Consider refactoring.
Open

function FeedbackForm() {
  var _instance = this;

  // The events this instance broadcasts.
  var _events = {
Severity: Minor
Found in app/javascript/app/FeedbackForm.js - About 1 hr to fix

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 DefaultPopup has a Cognitive Complexity of 14 (exceeds 6 allowed). Consider refactoring.
Open

function DefaultPopup() {
  var _instance = this;

  // The events this instance broadcasts.
  var _events = {
Severity: Minor
Found in app/javascript/app/popup/DefaultPopup.js - About 1 hr to fix

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 _checkIfFloating has a Cognitive Complexity of 12 (exceeds 6 allowed). Consider refactoring.
Open

function _checkIfFloating() {
  var c;
  if (window.scrollY >= _offsetY) {
    // Make the header float.
    _header.classList.add('floating');
Severity: Minor
Found in app/javascript/app/search/header.js - About 1 hr to fix

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 EventObserver has a Cognitive Complexity of 11 (exceeds 6 allowed). Consider refactoring.
Open

function EventObserver() {

  // The events registered on this instance.
  var _events = {};

Severity: Minor
Found in app/javascript/app/util/EventObserver.js - About 1 hr to fix

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 getOffset has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
Open

function getOffset(element) {
  var body = document.body,
  win = document.defaultView,
  docElem = document.documentElement,
  box = document.createElement('div');
Severity: Minor
Found in app/javascript/app/util/util.js - About 35 mins to fix

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 CharacterLimited has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
Open

function CharacterLimited(elm, defaults) {

  // The full, unlimited text.
  var _fulltext;

Severity: Minor
Found in app/javascript/app/detail/character-limited/CharacterLimited.js - About 35 mins to fix

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 TextInput has a Cognitive Complexity of 8 (exceeds 6 allowed). Consider refactoring.
Open

function TextInput(id) {
  var _instance = this;

  // The events this instance broadcasts.
  var _events = { CHANGE: 'change' };
Severity: Minor
Found in app/javascript/app/search/filter/TextInput.js - About 35 mins to fix

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 getWindowRect has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
Open

function getWindowRect() {
  var myWidth = 0, myHeight = 0;
  if ( typeof( window.innerWidth ) === 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
Severity: Minor
Found in app/javascript/app/util/util.js - About 25 mins to fix

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 updateInfoBoxState has a Cognitive Complexity of 7 (exceeds 6 allowed). Consider refactoring.
Open

function updateInfoBoxState(overMarker, delay) {
  // Clear any transitions in progress.
  if (_infoBoxDelay) clearTimeout(_infoBoxDelay);

  // If delay is not set use the default delay value.
Severity: Minor
Found in app/javascript/app/util/map/google/infobox-manager.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language