Wonder-Technology/Wonder-Editor

View on GitHub
lib/es6_global/src/core/atom_component/stringInput/StringInput.js

Summary

Maintainability
A
0 mins
Test Coverage

Function handleBlurAction has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Wontfix

function handleBlurAction(state, canBeNull, onBlurFunc) {
  if (canBeNull !== undefined) {
    var match = _isValueNotChange(state);
    if (match) {
      return /* NoUpdate */0;
Severity: Minor
Found in lib/es6_global/src/core/atom_component/stringInput/StringInput.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 make has 7 arguments (exceeds 4 allowed). Consider refactoring.
Wontfix

function make(defaultValue, label, title, onChange, onBlur, canBeNull, _children) {
Severity: Major
Found in lib/es6_global/src/core/atom_component/stringInput/StringInput.js - About 50 mins to fix

    Avoid too many return statements within this function.
    Wontfix

          return ReasonReactUtils$WonderEditor.updateWithSideEffects(/* record */[
                      /* inputValue */state[/* inputValue */0],
                      /* originValue */state[/* inputValue */0]
                    ], (function (_state) {
                        return triggerOnBlur(state[/* inputValue */0], onBlurFunc);
    Severity: Major
    Found in lib/es6_global/src/core/atom_component/stringInput/StringInput.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Wontfix

            return /* NoUpdate */0;
      Severity: Major
      Found in lib/es6_global/src/core/atom_component/stringInput/StringInput.js - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status