jibeinc/juice

View on GitHub

Showing 9 of 25 total issues

Function exports has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (config) {
  var configuration = {
    browsers: [
      'Chrome'
    ],
Severity: Minor
Found in karma.conf.js - About 1 hr to fix

Function constructor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(el, fetch, opts = {}) {
    const currentLocationText = opts.currentLocationText || 'Use my current location';
    const showLoaderOnCurrentLocation = opts.showLoaderOnCurrentLocation || false;

    // define the "current location" icon DOM fragment
Severity: Minor
Found in src/LocationTypeahead/index.js - About 1 hr to fix

Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(el, opts = {}) {
    super(el, {
      parentElement: opts.parentElement,
      preserveChildElements: true
    });
Severity: Minor
Found in src/Toggle/index.js - About 1 hr to fix

Function selectByIndex has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  selectByIndex() {
    if (!this.active()) {
      return;
    }

Severity: Minor
Found in src/Typeahead/index.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 constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(el, onScrollToBottom, opts = {}) {
    super(el, {
      preserveChildElements: true
    });

Severity: Minor
Found in src/InfiniteScroll/index.js - About 1 hr to fix

Function set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  set(v) {

    // If the textInput contains location data
    if (typeof v === 'object') {
      this.value = v;
Severity: Minor
Found in src/LocationTextInput/index.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(el, content, opts = {}) {
    if (typeof content === 'string') {
      super(el, {preserveChildElements: true});
      Object.assign(this, {
        closeButton: opts.closeButton || 'X',
Severity: Minor
Found in src/Modal/index.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 getDisplayValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getDisplayValue() {
    let display;

    for (const opt of this.options) {
      if (opt.selected) {
Severity: Minor
Found in src/SingleSelect/index.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 setOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  setOptions(options) {
    const selection = this.get();
    this.options = options.map((opt) => {
      if (typeof opt !== 'object') {
        opt = {
Severity: Minor
Found in src/RadioButtons/index.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