Function getFolderSource
has a Cognitive Complexity of 30 (exceeds 8 allowed). Consider refactoring. Open
func getFolderSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage) (StratosProject, string, error) {
// The msg data is JSON for the Folder info
info := FolderSourceInfo{
WaitAfterUpload: false,
}
- 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 CFAppPush.deploy
has 121 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (cfAppPush *CFAppPush) deploy(echoContext echo.Context) error {
cnsiGUID := echoContext.Param("cnsiGuid")
orgGUID := echoContext.Param("orgGuid")
spaceGUID := echoContext.Param("spaceGuid")
File deploy.go
has 562 lines of code (exceeds 500 allowed). Consider refactoring. Open
package cfapppush
import (
"encoding/base64"
"encoding/json"
Function getFolderSource
has 80 lines of code (exceeds 50 allowed). Consider refactoring. Open
func getFolderSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage) (StratosProject, string, error) {
// The msg data is JSON for the Folder info
info := FolderSourceInfo{
WaitAfterUpload: false,
}
Method CFAppPush.getGitSCMSource
has a Cognitive Complexity of 18 (exceeds 8 allowed). Consider refactoring. Open
func (cfAppPush *CFAppPush) getGitSCMSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage, userGUID string) (StratosProject, string, error) {
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 CFAppPush.getGitSCMSource
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (cfAppPush *CFAppPush) getGitSCMSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage, userGUID string) (StratosProject, string, error) {
var (
err error
)
Method CFAppPush.deploy
has a Cognitive Complexity of 16 (exceeds 8 allowed). Consider refactoring. Open
func (cfAppPush *CFAppPush) deploy(echoContext echo.Context) error {
cnsiGUID := echoContext.Param("cnsiGuid")
orgGUID := echoContext.Param("orgGuid")
spaceGUID := echoContext.Param("spaceGuid")
- 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 CFAppPush.deploy
has 13 return statements (exceeds 4 allowed). Open
func (cfAppPush *CFAppPush) deploy(echoContext echo.Context) error {
cnsiGUID := echoContext.Param("cnsiGuid")
orgGUID := echoContext.Param("orgGuid")
spaceGUID := echoContext.Param("spaceGuid")
Function getFolderSource
has 12 return statements (exceeds 4 allowed). Open
func getFolderSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage) (StratosProject, string, error) {
// The msg data is JSON for the Folder info
info := FolderSourceInfo{
WaitAfterUpload: false,
}
Function fetchManifest
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func fetchManifest(repoPath string, stratosProject StratosProject, clientWebSocket *websocket.Conn) (Applications, string, error) {
var manifest Applications
// Can be either manifest.yml or manifest.yaml
- 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 CFAppPush.getConfigData
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
func (cfAppPush *CFAppPush) getConfigData(echoContext echo.Context, cnsiGUID string, orgGUID string, spaceGUID string, spaceName string, orgName string, clientWebSocket *websocket.Conn) (*CFPushAppConfig, error) {
Method CFAppPush.getGitSCMSource
has 7 return statements (exceeds 4 allowed). Open
func (cfAppPush *CFAppPush) getGitSCMSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage, userGUID string) (StratosProject, string, error) {
var (
err error
)
Function fetchManifest
has 5 return statements (exceeds 4 allowed). Open
func fetchManifest(repoPath string, stratosProject StratosProject, clientWebSocket *websocket.Conn) (Applications, string, error) {
var manifest Applications
// Can be either manifest.yml or manifest.yaml