Showing 94 of 184 total issues
Method Receiver.ApplyStoredMsgs
has a Cognitive Complexity of 217 (exceeds 20 allowed). Consider refactoring. Open
func (recv *Receiver) ApplyStoredMsgs() {
for {
select {
- 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 Mailbox.Store
has a Cognitive Complexity of 103 (exceeds 20 allowed). Consider refactoring. Open
func (mailbox *Mailbox) Store(s *Session, req *Request, syncChan chan comm.Msg) (*Reply, error) {
if s.State != StateMailbox {
// If connection was not in correct state when this
- 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 service.handleConnection
has a Cognitive Complexity of 103 (exceeds 20 allowed). Consider refactoring. Open
func (s *service) handleConnection(conn net.Conn, greeting string) {
// Assert we are talking via a TLS connection.
tlsConn, ok := conn.(*tls.Conn)
if ok != true {
- 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
File service.go
has 875 lines of code (exceeds 500 allowed). Consider refactoring. Open
package distributor
import (
"bufio"
"fmt"
Method Sender.SendMsgs
has a Cognitive Complexity of 84 (exceeds 20 allowed). Consider refactoring. Open
func (sender *Sender) SendMsgs(waitSeconds time.Duration) {
// Specify duration to wait between triggers.
triggerD := waitSeconds * time.Second
- 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
Function main
has 267 lines of code (exceeds 50 allowed). Consider refactoring. Open
func main() {
var err error
// Set CPUs usable by pluto to all available.
Method service.handleConnection
has 246 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (s *service) handleConnection(conn net.Conn, greeting string) {
// Assert we are talking via a TLS connection.
tlsConn, ok := conn.(*tls.Conn)
if ok != true {
Function main
has a Cognitive Complexity of 71 (exceeds 20 allowed). Consider refactoring. Open
func main() {
var err error
// Set CPUs usable by pluto to all available.
- 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 Receiver.ApplyStoredMsgs
has 225 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (recv *Receiver) ApplyStoredMsgs() {
for {
select {
Method Mailbox.Store
has 196 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (mailbox *Mailbox) Store(s *Session, req *Request, syncChan chan comm.Msg) (*Reply, error) {
if s.State != StateMailbox {
// If connection was not in correct state when this
File source.go
has 675 lines of code (exceeds 500 allowed). Consider refactoring. Open
package imap
import (
"fmt"
"os"
Method Mailbox.ApplyStore
has 151 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (mailbox *Mailbox) ApplyStore(storeUpd *comm.Msg_STORE) {
createdMailbox := false
rmElements := map[string]string{
Method Mailbox.ApplyStore
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
func (mailbox *Mailbox) ApplyStore(storeUpd *comm.Msg_STORE) {
createdMailbox := false
rmElements := map[string]string{
- 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 Sender.SendMsgs
has 142 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (sender *Sender) SendMsgs(waitSeconds time.Duration) {
// Specify duration to wait between triggers.
triggerD := waitSeconds * time.Second
Function main
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func main() {
// Parse supplied command-line flags.
plutoConfigFlag := flag.String("pluto-config", "config.toml", "If you use a custom config path specify it via this flag")
rootCertPathFlag := flag.String("root-cert-path", "", "If you want to use an existing root certificate, specify the path")
- 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 service.ProxyAppend
has 125 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (s *service) ProxyAppend(c *Connection, rawReq string) bool {
// Prepare payload to send.
payload := &imap.Command{
Text: rawReq,
Function TestApplyStoredMsgs
has 125 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestApplyStoredMsgs(t *testing.T) {
// Create logger.
logger := log.NewLogfmtLogger(log.NewSyncWriter(os.Stdout))
logger = log.With(logger,
Method Mailbox.ApplyAppend
has 123 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (mailbox *Mailbox) ApplyAppend(appendUpd *comm.Msg_APPEND) {
// For APPEND, STORE, and EXPUNGE we interpret the
// the folder name as value and the mail file name
// as tag in downstream message.
Function ParseSeqNumbers
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func ParseSeqNumbers(recv string, lenMailboxContents int) ([]int, error) {
// If supplied number of mail messages in selected
// folder indicated an empty mailbox, immediately return.
if lenMailboxContents == 0 {
- 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
Function main
has 121 lines of code (exceeds 50 allowed). Consider refactoring. Open
func main() {
// Parse supplied command-line flags.
plutoConfigFlag := flag.String("pluto-config", "config.toml", "If you use a custom config path specify it via this flag")
rootCertPathFlag := flag.String("root-cert-path", "", "If you want to use an existing root certificate, specify the path")