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
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 AllAvailablePluginsWithOptions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
pluginDir string,
checksumsFile string,
internalLookupFunc InternalPluginLookupFunc,
externalLookupfunc ExternalPluginLookupFunc,
logger log.Logger,
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 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)
}
Function TestConfigEnv
has 8 return statements (exceeds 7 allowed). Open
func TestConfigEnv(t *testing.T) {
// Shared mocks and doubles
logger := loggermock.NewLogger()
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 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 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
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 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
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
package conjur
- 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
/*
- Exclude checks
Your code does not pass gofmt in 2 places. Go fmt your code! Open
package client
- Exclude checks
Line length Open
[documented instructions](https://docs.secretless.io/Latest/en/Content/References/connectors/scl_handlers-https.htm#Manageservercertificates) for adding the
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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.