Showing 57 of 79 total issues
Function WatchNotifications
has a Cognitive Complexity of 64 (exceeds 20 allowed). Consider refactoring. Open
func WatchNotifications(
accounts []AccountConfig,
databaseConnection *sql.DB,
updateInterval time.Duration,
stop chan struct{},
- 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 Untar
has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring. Open
func Untar(options UntarOptions) []error {
var err error
status := UntarStatus{}
if options.Events == nil {
- 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 WatchNotifications
has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring. Open
func WatchNotifications(
accessToken string,
fromProjects Projects,
databaseConnection *sql.DB,
updateInterval time.Duration,
- 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 GetCommand
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
func GetCommand() *cobra.Command {
cmd := cobra.Command{
Use: constants.SoftwareCanonicalNoun,
Aliases: constants.SoftwareAliases,
Short: "verifies that required software specified in the configuration is installed",
- 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 Unzip
has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring. Open
func Unzip(options UnzipOptions) []error {
var err error
status := UnzipStatus{}
if options.Events == nil {
- 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 Untar
has 123 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Untar(options UntarOptions) []error {
var err error
status := UntarStatus{}
if options.Events == nil {
Function Unzip
has 102 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Unzip(options UnzipOptions) []error {
var err error
status := UnzipStatus{}
if options.Events == nil {
Function run
has 86 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(command *cobra.Command, args []string) {
if len(args) == 0 {
command.Help()
log.Errorf("no repository url(s) specified, see usage above for how to use this command")
os.Exit(1)
Function getOAuthCallbackHandler
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getOAuthCallbackHandler(res http.ResponseWriter, req *http.Request) {
requestID := uuid.New().String()
params := mux.Vars(req)
Function Download
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Download(options DownloadOptions) error {
downloadStatus := DownloadStatus{}
tmpFilePath := options.FilePath + ".download_" + time.Now().Format("20060102150405")
if options.Events == nil {
options.Events = make(chan DownloadEvent, 16)
Function run
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(command *cobra.Command, args []string) {
if config.Global.Repositories == nil {
log.Error("no repositories have been defined")
os.Exit(1)
return
Function WatchNotifications
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
func WatchNotifications(
accounts []AccountConfig,
databaseConnection *sql.DB,
updateInterval time.Duration,
stop chan struct{},
Function run
has 65 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(command *cobra.Command, args []string) {
if config.Global.Repositories == nil {
log.Error("no repositories have been defined")
os.Exit(1)
return
Function GetCommand
has 65 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetCommand() *cobra.Command {
cmd := cobra.Command{
Use: constants.ClientCanonicalNoun,
Aliases: constants.ClientAliases,
Short: "starts the dev client as a background process to provide notifications",
Function GetCommand
has 65 lines of code (exceeds 50 allowed). Consider refactoring. Open
func GetCommand() *cobra.Command {
cmd := cobra.Command{
Use: constants.SoftwareCanonicalNoun,
Aliases: constants.SoftwareAliases,
Short: "verifies that required software specified in the configuration is installed",
Function startFuzzySearchInterface
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func startFuzzySearchInterface() {
links := config.Global.Links
repositories := config.Global.Repositories
for _, link := range links {
searchTerms = append(searchTerms, fmt.Sprintf("%s [%s] @ %s", link.Label, strings.Join(link.Categories, ", "), link.URL))
Function run
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func run(command *cobra.Command, args []string) {
targetWorkspaceName := strings.Join(args, ".")
if len(targetWorkspaceName) == 0 {
command.Help()
workspaces := c.Global.Repositories.GetWorkspaces()
Function GetCommand
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func GetCommand() *cobra.Command {
cmd := cobra.Command{
Use: constants.AccountCanonicalNoun,
Aliases: constants.AccountAliases,
Short: "Retrieves account information from Trello",
- 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 TodoSerializer.GetMessage
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (ts TodoSerializer) GetMessage() string {
targetType := ts.getTargetType()
createdAt := humanize.Time(ts.CreatedAt)
switch ts.ActionName {
case "assigned":
Function WatchNotifications
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func WatchNotifications(
accessToken string,
fromProjects Projects,
databaseConnection *sql.DB,
updateInterval time.Duration,