grommet/grommet-ferret

View on GitHub

Showing 386 of 386 total issues

Function parseQuery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function parseQuery (query) {

  const parsers = [
    parseSpace,
    parseParens,
Severity: Minor
Found in server/filter.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 filterFilter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function filterFilter (items, filterParam) {
  // convert filter to something more useful for comparison
  let filter = {};
  (typeof filterParam === 'string' ? [filterParam] : filterParam)
    .forEach((term) => {
Severity: Minor
Found in server/filter.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 _parseLocationSearch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function _parseLocationSearch (search) {
  let result = {};
  if (search.q) {
    result.query = new Query(decodeURIComponent(search.q));
  }
Severity: Minor
Found in src/js/actions/indexHistory.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 _onChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _onChange (event) {
    let directory = { ...this.props.directory };
    let errors = { ...this.state.errors };
    const attribute = event.target.getAttribute('name');
    const value = event.target.value;
Severity: Minor
Found in src/js/components/settings/DirectoryEdit.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 onMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function onMessage (connection, request) {
  if ('start' === request.op) {
    // Split out query parameters
    const parts = request.uri.split('?');
    request.uri = parts[0];
Severity: Minor
Found in server/rest.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 _renderItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  _renderItem (item) {
    let result;
    if (item) {
      let state, timestamp, percentComplete;
      if ('tasks' === item.category) {
Severity: Minor
Found in src/js/components/Notifications.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