http.go
Method HTTPDownloader.Do
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
Open
func (d *HTTPDownloader) Do(doneChan chan bool, fileChan chan string, errorChan chan error, interruptChan chan bool, stateSaveChan chan Part) {
var ws sync.WaitGroup
var bars []*pb.ProgressBar
var barpool *pb.Pool
var err error
- 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 HTTPDownloader.Do
has 101 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (d *HTTPDownloader) Do(doneChan chan bool, fileChan chan string, errorChan chan error, interruptChan chan bool, stateSaveChan chan Part) {
var ws sync.WaitGroup
var bars []*pb.ProgressBar
var barpool *pb.Pool
var err error
Function NewHTTPDownloader
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func NewHTTPDownloader(url string, par int, skipTLS bool, proxyServer string, bwLimit string) *HTTPDownloader {
var resumable = true
client := ProxyAwareHTTPClient(proxyServer)
parsed, err := stdurl.Parse(url)
Method HTTPDownloader.Do
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
Wontfix
func (d *HTTPDownloader) Do(doneChan chan bool, fileChan chan string, errorChan chan error, interruptChan chan bool, stateSaveChan chan Part) {
Function NewHTTPDownloader
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
Wontfix
func NewHTTPDownloader(url string, par int, skipTLS bool, proxyServer string, bwLimit string) *HTTPDownloader {
2: cannot find package "github.com/alecthomas/units" in any of: Wontfix
Wontfix
"github.com/alecthomas/units"
- Exclude checks