cyberark/secretless-broker

View on GitHub

Showing 1,856 of 1,876 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 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 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 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 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

            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 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

                  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 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

                    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 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

                    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

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

                    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

                    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

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

                    Multiple headers with the same content
                    Open

                    #### Example Usage

                    MD024 - Multiple headers with the same content

                    Tags: headers

                    Aliases: no-duplicate-header

                    Parameters: allowdifferentnesting (boolean; default false)

                    This rule is triggered if there are multiple headers in the document that have the same text:

                    # Some text
                    
                    ## Some text

                    To fix this, ensure that the content of each header is different:

                    # Some text
                    
                    ## Some more text

                    Rationale: Some markdown parses generate anchors for headers based on the header name, and having headers with the same content can cause problems with this.

                    If the parameter allow_different_nesting is set to true, header duplication under different nesting is allowed, like it usually happens in change logs:

                    # Change log
                    
                    ## 2.0.0
                    
                    ### Bug fixes
                    
                    ### Features
                    
                    ## 1.0.0
                    
                    ### Bug fixes

                    Fenced code blocks should be surrounded by blank lines
                    Open

                         ```

                    MD031 - Fenced code blocks should be surrounded by blank lines

                    Tags: code, blank_lines

                    Aliases: blanks-around-fences

                    This rule is triggered when fenced code blocks are either not preceded or not followed by a blank line:

                    Some text
                    ```
                    Code block
                    ```
                    
                    ```
                    Another code block
                    ```
                    Some more text

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

                    Some text
                    
                    ```
                    Code block
                    ```
                    
                    ```
                    Another code block
                    ```
                    
                    Some more text

                    Rationale: Aside from aesthetic reasons, some parsers, including kramdown, will not parse fenced code blocks that don't have blank lines before and after them.

                    Severity
                    Category
                    Status
                    Source
                    Language