fga-eps-mds/2019.1-unbrake

View on GitHub

Showing 10 of 321 total issues

Function onReady has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
Open

func onReady() {
    systray.SetIcon(IconDisabled)
    systray.SetTitle("UnBrake")
    systray.SetTooltip("UnBrake")

Severity: Minor
Found in unbrake-local/unbrake.go - About 2 hrs 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 createMutationUrl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const createMutationUrl = async (
  informations,
  variableNames,
  values
) => {
Severity: Minor
Found in unbrake-frontend/src/utils/Request.jsx - 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 calculeTES has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const calculeTES = (states, handleChange) => {
  const { dutyCycle, waiting, waitingStartTime, state } = states;

  if (state.TEI !== zero) handleChange("TEI", zero);

Severity: Minor
Found in unbrake-frontend/src/testModule/TestDataAux.jsx - About 45 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 resolveMsg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const resolveMsg = (msg, states, functions) => {
  if (msg.channel === "unbrake/galpao/temperature/sensor1/") {
    calculeTemperature(states, states.sensorTemperature1, one);
  } else if (msg.channel === "unbrake/galpao/temperature/sensor2/") {
    calculeTemperature(states, states.sensorTemperature2, two);
Severity: Minor
Found in unbrake-frontend/src/testModule/TabMenuComponent.jsx - 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 validateConfig has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const validateConfig = (configuration, sendMessage) => {
  let createMessage = configFields.reduce((prevMessage, newField) => {
    if (
      configuration[newField.front] === undefined ||
      configuration[newField.front].length === empty
Severity: Minor
Found in unbrake-frontend/src/testModule/TestFunctions.jsx - 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 verifyCheckbox has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const verifyCheckbox = (functions, state) => {
  const { dispatch } = functions;
  if (state === "acelerating" || state === "aceleratingWater") {
    setCheckboxes([true, false, false], dispatch);
  } else if (state === "braking" || state === "brakingWater") {
Severity: Minor
Found in unbrake-frontend/src/testModule/TabMenuComponent.jsx - 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 submit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const submit = (states, functions, dispatchs) => {
  const values = {
    calibration: states.calibration.values,
    name: "",
    createCalibration
Severity: Minor
Found in unbrake-frontend/src/testModule/TestFunctions.jsx - 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

Method Experiment.watchSpeed has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
Open

func (experiment *Experiment) watchSpeed() {

    experiment.watch(func() {

        frequency := <-serialAttrs[frequencyIdx].handleCh
Severity: Minor
Found in unbrake-local/experiment.go - 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 handleSubmit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  handleSubmit() {
    const { configuration, name, isDefault } = this.state;
    const { sendMessage, redirect, changeConfig } = this.props;
    const dispatchs = { sendMessage, changeConfig };

Severity: Minor
Found in unbrake-frontend/src/configuration/Configuration.jsx - 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 labels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const labels = name => {
  if (labelCommand(name) !== "") return labelCommand(name);
  if (labelForce(name) !== "") return labelForce(name);
  if (labelRelation(name) !== "") return labelRelation(name);
  if (labelSpeed(name) !== "") return labelSpeed(name);
Severity: Minor
Found in unbrake-frontend/src/calibration/CalibrationVariables.jsx - 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