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
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 {
Function AllAvailablePluginsWithOptions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
pluginDir string,
checksumsFile string,
internalLookupFunc InternalPluginLookupFunc,
externalLookupfunc ExternalPluginLookupFunc,
logger log.Logger,
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) {
Function TestConfigEnv
has 8 return statements (exceeds 7 allowed). Open
func TestConfigEnv(t *testing.T) {
// Shared mocks and doubles
logger := loggermock.NewLogger()
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 {
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
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)
}
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
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++) {
- 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 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(
"",
"",
- 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 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);
- 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
Your code does not pass gofmt in 3 places. Go fmt your code! Open
// Package testutil has utilities for unit testing Secretless databases. Code
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
/*
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
/*
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
package client
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
/*
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
package conjur
- Exclude checks
Multiple headers with the same content Open
#### Example Usage
- Read upRead up
- Exclude checks
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
```
- Read upRead up
- Exclude checks
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.