question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix "method_complexity" issue in src/instanceMethods/close.js

See original GitHub issue

Function close has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.

https://codeclimate.com/github/sweetalert2/sweetalert2/src/instanceMethods/close.js#issue_5cae1f5bcb82c9000100006f

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
JulianoGTZcommented, Jun 17, 2019

I can work in this issue. I want to familiarize myself with the code so I can contribute to bigger problems 😄 .

1reaction
limontecommented, Jul 1, 2019

@JulianoGTZ the issue shod be resolved now, please run npm i once again to update the terser dependency

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Refactoring Tips — Reducing Function Complexity
In this article, we'll look at ways to reduce the complexity of our JavaScript functions. Move Repeated Code into a Single Location. We...
Read more >
Refactor this method to reduce its Cognitive Complexity from ...
First of all it is important to understand how "Cognitive Complexity" works as compared to "Cyclomatic Complexity". Cognitive complexity takes ...
Read more >
Comprehensive Guide to JavaScript Design Patterns | Toptal
Design patterns are reusable solutions to commonly occurring problems in software design. Let's take a look at how they work and explore some...
Read more >
Time complexity Big 0 for Javascript Array methods and ...
So, let's start with a quick definition of the method, his time complexity, and a small example. Mutator Methods. 1. push() - 0(1)...
Read more >
Refactoring to Reduce Method Complexity - Mark Heath
The most common reason for a method being very long, or deeply nested is simply that it is performing more than one task....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found