cyberark/secretless-broker

View on GitHub

Showing 1,859 of 1,879 total issues

Function UnpackOkResponse has 9 return statements (exceeds 7 allowed).
Open

func UnpackOkResponse(packet []byte) (*OkResponse, error) {

    // Min packet length = header(4 bytes) + PacketType(1 byte)
    if err := CheckPacketLength(5, packet); err != nil {
        return nil, err
Severity: Major
Found in internal/plugin/connectors/tcp/mysql/protocol/protocol.go - About 40 mins to fix

    Function InjectCredentials has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func InjectCredentials(authPlugin string, clientHandshake *HandshakeResponse41, salt []byte, username string, password string) (err error) {
    Severity: Minor
    Found in internal/plugin/connectors/tcp/mysql/protocol/protocol.go - About 35 mins to fix

      Function AllAvailablePluginsWithOptions has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          pluginDir string,
          checksumsFile string,
          internalLookupFunc InternalPluginLookupFunc,
          externalLookupfunc ExternalPluginLookupFunc,
          logger log.Logger,
      Severity: Minor
      Found in pkg/secretless/plugin/sharedobj/available_plugins.go - About 35 mins to fix

        Function runTest has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func runTest(backendName string, threadIndex int, aggregateTimings *timing.AggregateTimings,
            testManager *TestManager, round int) time.Duration {
        Severity: Minor
        Found in bin/juxtaposer/main.go - About 35 mins to fix

          Function RemoveSSLFromHandshakeV10 has 8 return statements (exceeds 7 allowed).
          Open

          func RemoveSSLFromHandshakeV10(packet []byte) ([]byte, error) {
              r := bytes.NewReader(packet)
              initialLen := r.Len()
          
              // Skip packet header
          Severity: Major
          Found in internal/plugin/connectors/tcp/mysql/protocol/protocol.go - About 35 mins to fix

            Function ProviderFactory has 8 return statements (exceeds 7 allowed).
            Open

            func ProviderFactory(options plugin_v1.ProviderOptions) (plugin_v1.Provider, error) {
                config, err := conjurapi.LoadConfig()
                if err != nil {
                    return nil, fmt.Errorf("ERROR: Conjur provider could not load configuration: %s", err)
                }
            Severity: Major
            Found in internal/providers/conjur/provider.go - About 35 mins to fix

              Function TestConfigEnv has 8 return statements (exceeds 7 allowed).
              Open

              func TestConfigEnv(t *testing.T) {
              
                  // Shared mocks and doubles
              
                  logger := loggermock.NewLogger()
              Severity: Major
              Found in pkg/secretless/config/v2/config_env_test.go - About 35 mins to fix

                Method ServiceConnector.Connect has 8 return statements (exceeds 7 allowed).
                Open

                func (h *ServiceConnector) Connect(
                    credentialValuesByID connector.CredentialValuesByID,
                ) error {
                    var err error
                    var serverConfig ServerConfig
                Severity: Major
                Found in internal/plugin/connectors/ssh/service_connector.go - About 35 mins to fix

                  Function RegisterCRDListener has 8 return statements (exceeds 7 allowed).
                  Open

                  func RegisterCRDListener(namespace string, configSpec string, resourceEventHandler ResourceEventHandler) error {
                      log.Printf("%s: Registering CRD watcher...", PluginName)
                  
                      clientConfig, err := NewKubernetesConfig()
                      if err != nil {
                  Severity: Major
                  Found in internal/configurationmanagers/kubernetes/crd/crd_watcher.go - About 35 mins to fix

                    Function getClipboardText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getClipboardText(block) {
                      var codeType = block.getAttribute("data-lang");
                    
                      if (codeType == "shell") {
                        return extractShellCommand(block);
                    Severity: Minor
                    Found in docs/javascript/clipboard-buttons.js - About 25 mins to fix

                    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 TestExternalPlugins has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                    Open

                    func TestExternalPlugins(t *testing.T) {
                        t.Run("Assembles external plugins", func(t *testing.T) {
                            externalPlugins, err := ExternalPluginsWithOptions(
                                "",
                                "",
                    Severity: Minor
                    Found in pkg/secretless/plugin/sharedobj/external_plugins_test.go - About 25 mins to fix

                    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 extractIrbCommands has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function extractIrbCommands(irbBlock) {
                      var blockLines = irbBlock.innerText.split("\n");
                      var command = "";
                    
                      for (var j = 0; j < blockLines.length; j++) {
                    Severity: Minor
                    Found in docs/javascript/clipboard-buttons.js - About 25 mins to fix

                    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

                    Your code does not pass gofmt in 3 places. Go fmt your code!
                    Open

                    // Package testutil has utilities for unit testing Secretless databases. Code
                    Severity: Minor
                    Found in test/util/testutil/types.go by gofmt

                    Your code does not pass gofmt in 2 places. Go fmt your code!
                    Open

                    package conjur
                    Severity: Minor
                    Found in internal/providers/conjur/provider.go by gofmt

                    Your code does not pass gofmt in 2 places. Go fmt your code!
                    Open

                    /*
                    Severity: Minor
                    Found in internal/proxyservice/doc.go by gofmt

                    Your code does not pass gofmt in 2 places. Go fmt your code!
                    Open

                    /*

                    Your code does not pass gofmt in 2 places. Go fmt your code!
                    Open

                    /*
                    Severity: Minor
                    Found in pkg/secretless/plugin/doc.go by gofmt

                    Your code does not pass gofmt in 2 places. Go fmt your code!
                    Open

                    package client

                    Line length
                    Open

                    [documented instructions](https://docs.secretless.io/Latest/en/Content/References/connectors/scl_handlers-https.htm#Manageservercertificates) for adding the

                    MD013 - Line length

                    Tags: line_length

                    Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

                    This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

                    This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

                    You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

                    Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

                    Headers should be surrounded by blank lines
                    Open

                    ## Table of Contents

                    MD022 - Headers should be surrounded by blank lines

                    Tags: headers, blank_lines

                    Aliases: blanks-around-headers

                    This rule is triggered when headers (any style) are either not preceded or not followed by a blank line:

                    # Header 1
                    Some text
                    
                    Some more text
                    ## Header 2

                    To fix this, ensure that all headers have a blank line both before and after (except where the header is at the beginning or end of the document):

                    # Header 1
                    
                    Some text
                    
                    Some more text
                    
                    ## Header 2

                    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse headers that don't have a blank line before, and will parse them as regular text.

                    Severity
                    Category
                    Status
                    Source
                    Language