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")
- 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 createMutationUrl
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const createMutationUrl = async (
informations,
variableNames,
values
) => {
- 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 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);
- 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 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);
- 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 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
- 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 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") {
- 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 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
- 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
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
- 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 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 };
- 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 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);
- 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"