ucsd-cse112/team13

View on GitHub

Showing 10 of 45 total issues

Function createPropertyDescriptor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function createPropertyDescriptor(property, opts) {
  const dataKey = `__${property}`;
  return {
    get() {
      let value;
Severity: Minor
Found in src/core-element/WebElementUtil.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 createCoreTooltip has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

function createCoreTooltip(content, openDelay, closeDelay, placement,
  focusable, forID, offset, effect, noVisibleArrow, manual, disabled) {
Severity: Major
Found in stories/core-tooltip.stories.js - About 1 hr to fix

    Function createPropertyDescriptor has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function createPropertyDescriptor(property, opts) {
      const dataKey = `__${property}`;
      return {
        get() {
          let value;
    Severity: Minor
    Found in src/core-element/WebElementUtil.js - About 1 hr to fix

      Function createCoreSlider has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function createCoreSlider(value, min, max, step, color, vertical, rainbow, disabled) {
      Severity: Major
      Found in stories/core-slider.stories.js - About 1 hr to fix

        Function requestPropertyUpdate has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function requestPropertyUpdate(element, property, opts, oldValue, newValue, side) {
        Severity: Minor
        Found in src/core-element/WebElementUtil.js - About 45 mins to fix

          Function cleanupInputEventListeners has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function cleanupInputEventListeners(e, upEvent, upListener, moveEvent, moveListener) {
          Severity: Minor
          Found in src/core-slider/CoreSliderElement.js - About 35 mins to fix

            Function createCoreLink has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function createCoreLink(textContent, href, type, underline, disabled) {
            Severity: Minor
            Found in stories/core-link.stories.js - About 35 mins to fix

              Function setupInputEventListeners has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function setupInputEventListeners(e, upEvent, upListener, moveEvent, moveListener) {
              Severity: Minor
              Found in src/core-slider/CoreSliderElement.js - About 35 mins to fix

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

                  updateThumbPosition(value) {
                    // Calculates the value with respect to the defined range (from this.min and this.max)
                    const stepSize = this.step;
                    const minValue = this.min;
                    const maxValue = this.max;
                Severity: Minor
                Found in src/core-slider/CoreSliderElement.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 addProperty has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                export function addProperty(element, property, opts) {
                  const propertyDescriptor = createPropertyDescriptor(property, opts);
                
                  // Upgrade initially set property. So any properties defined in the constructor (or earlier by
                  // other frameworks) are treated as default values for the new created property.
                Severity: Minor
                Found in src/core-element/WebElementUtil.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