CloudSlang/cs-actions

View on GitHub

Showing 3,994 of 4,023 total issues

Method needsEncoding has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static boolean needsEncoding(String s, boolean relax, boolean[] unreserved) {
        int len = s.length();
        for (int i = 0; i < len; ++i) {
            char c = s.charAt(i);
            if (c == '%' && relax) {

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

    private void setBlockDeviceMappingQueryParams(Map<String, String> queryParamsMap, InputsWrapper wrapper) {
        String[] deviceNamesArray = getArrayWithoutDuplicateEntries(wrapper.getEbsInputs().getBlockDeviceMappingDeviceNamesString(),
                BLOCK_DEVICE_MAPPING_DEVICE_NAMES_STRING, wrapper.getCommonInputs().getDelimiter());
        String[] virtualNamesArray = getArrayWithoutDuplicateEntries(wrapper.getEbsInputs().getBlockDeviceMappingVirtualNamesString(),
                BLOCK_DEVICE_MAPPING_VIRTUAL_NAMES_STRING, wrapper.getCommonInputs().getDelimiter());

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

Avoid deeply nested control flow statements.
Open

                                if (protocol.toUpperCase().equals(TLSv12.toUpperCase()))
                                    tls12 = protocol;

    Method buildCredentialsProvider has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public CredentialsProvider buildCredentialsProvider() {
            CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
    
            if (!StringUtils.isEmpty(username)) {
                Credentials credentials;

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

        public ContentType buildContentType() {
            ContentType parsedContentType = null;
            if (StringUtils.isNotBlank(contentType)) {
                try {
                    parsedContentType = ContentType.parse(contentType);

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

        public Map<String, String> getDescribeImagesQueryParamsMap(InputsWrapper wrapper) {
            Map<String, String> queryParamsMap = new HashMap<>();
            setCommonQueryParamsMap(queryParamsMap, wrapper.getCommonInputs().getAction(), wrapper.getCommonInputs().getVersion());
            setOptionalMapEntry(queryParamsMap, EXECUTABLE_BY + DOT + ONE, valueOf(wrapper.getCustomInputs().getIdentityId()),
                    isNotBlank(valueOf(wrapper.getCustomInputs().getIdentityId())));

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

        public CookieStore buildCookieStore() {
            if (Boolean.parseBoolean(useCookies) && cookieStoreSessionObject != null) {
                BasicCookieStore cookieStore;
                if (cookieStoreSessionObject.getValue() == null) {
                    cookieStore = new BasicCookieStore();

    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 getCanonicalRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public String getCanonicalRequest(String httpRequestMethod, String canonicalURI, String canonicalQueryString,
                                          String canonicalHeaders, String signedHeaders, String requestPayload) throws SignatureException {

      Avoid deeply nested control flow statements.
      Open

                                      if (protocol.toUpperCase().equals(TLSv13.toUpperCase()))
                                          tls13 = protocol;

        Avoid deeply nested control flow statements.
        Open

                                if (line.contains(allowedItem[0]) && line.contains(allowedItem[1])) {
                                    skip[x] = true;
                                    break;
                                }

          Avoid deeply nested control flow statements.
          Open

                                  if (nameValuePair.getName().equalsIgnoreCase("charset")) {
                                      responseCharacterSet = nameValuePair.getValue();
                                      break;
                                  }

            Method setDataRows has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static int setDataRows(final Sheet worksheet,
                                              final String rowData,
                                              final String rowDelimiter,
                                              final String columnDelimiter,
                                              final int startRowIndex,

              Method execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Action(name = "Update pg_hba.config",
                          outputs = {
                                  @Output(RETURN_CODE),
                                  @Output(RETURN_RESULT),
                                  @Output(EXCEPTION),

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

                  @Action(name =LIST_ORGANIZATIONS_OPERATION_NAME ,
                          description = LIST_ORGANIZATIONS_OPERATION_DESC,
                          outputs = {
                                  @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                                  @Output(value = EXCEPTION, description = EXCEPTION_DESC),

              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

              Avoid deeply nested control flow statements.
              Open

                                      if (cellFormat.equalsIgnoreCase("string") && inputFormat.equalsIgnoreCase("string")) {
                                          DataFormatter aFormatter = new DataFormatter();
                                          String aCellString = aFormatter.formatCellValue(cell);
                                          if (compareStringValue(aCellString, input, operator)) {
                                              result += i + ",";

                Method execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Action(name = LIST_WORKSPACES_OPERATION_NAME,
                            description = LIST_WORKSPACES_OPERATION_DESC,
                            outputs = {
                                    @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                                    @Output(value = EXCEPTION, description = EXCEPTION_DESC),

                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 setConnectionParameters has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static void setConnectionParameters(HttpClientInputs httpClientInputs,
                                                               @NotNull final String connectTimeout,
                                                               @NotNull final String socketTimeout,
                                                               @NotNull final String keepAlive,
                                                               @NotNull final String connectionsMaxPerRoot,

                  Method execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      @Action(name = LIST_OAUTH_CLIENT_OPERATION_NAME,
                              description = LIST_OAUTH_CLIENT_DESC,
                              outputs = {
                                      @Output(value = RETURN_RESULT, description = RETURN_RESULT_DESC),
                                      @Output(value = OAUTH_TOKEN_ID, description = OAUTH_TOKEN_ID_DESCRIPTION),

                  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

                  Avoid deeply nested control flow statements.
                  Open

                                          if (cellString.indexOf("?/?") > 1 && cell.getCellType() == CellType.NUMERIC) {
                                              result.append(cell.getNumericCellValue());
                                          }
                  
                                          //Formula

                    Avoid deeply nested control flow statements.
                    Open

                                            switch (cellValue.getCellType()) {
                                                case BOOLEAN:
                                                    cell.setCellType(CellType.STRING);
                                                    break;
                                                case NUMERIC:
                      Severity
                      Category
                      Status
                      Source
                      Language