open-wa/whatsapp-button

View on GitHub
storybook-static/polyfills/regenerator-runtime.de2e6a3a74a500cae72a3cab1a403efc.js

Summary

Maintainability
F
1 wk
Test Coverage

Function runtime has a Cognitive Complexity of 232 (exceeds 5 allowed). Consider refactoring.
Open

var runtime = (function (exports) {
  "use strict";

  var Op = Object.prototype;
  var hasOwn = Op.hasOwnProperty;

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 runtime has 486 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var runtime = (function (exports) {
  "use strict";

  var Op = Object.prototype;
  var hasOwn = Op.hasOwnProperty;

    File regenerator-runtime.de2e6a3a74a500cae72a3cab1a403efc.js has 500 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Copyright (c) 2014-present, Facebook, Inc.
     *
     * This source code is licensed under the MIT license found in the
     * LICENSE file in the root directory of this source tree.

      Function makeInvokeMethod has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function makeInvokeMethod(innerFn, self, context) {
          var state = GenStateSuspendedStart;
      
          return function invoke(method, arg) {
            if (state === GenStateExecuting) {

        Function invoke has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            return function invoke(method, arg) {
              if (state === GenStateExecuting) {
                throw new Error("Generator is already running");
              }
        
        

          Function maybeInvokeDelegate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function maybeInvokeDelegate(delegate, context) {
              var method = delegate.iterator[context.method];
              if (method === undefined) {
                // A .throw or .return when the delegate iterator has no .throw
                // method always terminates the yield* loop.

            Function dispatchException has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                dispatchException: function(exception) {
                  if (this.done) {
                    throw exception;
                  }
            
            

              Function AsyncIterator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function AsyncIterator(generator, PromiseImpl) {
                  function invoke(method, arg, resolve, reject) {
                    var record = tryCatch(generator[method], generator, arg);
                    if (record.type === "throw") {
                      reject(record.arg);

                Avoid deeply nested control flow statements.
                Open

                            if (this.prev < entry.catchLoc) {
                              return handle(entry.catchLoc, true);
                            }

                  Avoid deeply nested control flow statements.
                  Open

                            } else if (hasFinally) {
                              if (this.prev < entry.finallyLoc) {
                                return handle(entry.finallyLoc);
                              }
                  
                  

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

                      exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {

                      Avoid too many return statements within this function.
                      Open

                            return info;

                        Avoid too many return statements within this function.
                        Open

                                      return handle(entry.finallyLoc);

                          Avoid too many return statements within this function.
                          Open

                              return ContinueSentinel;

                            There are no issues that match your filters.

                            Category
                            Status