CloudSlang/cs-actions

View on GitHub

Showing 2,059 of 4,023 total issues

Avoid too many return statements within this method.
Open

                return list;
Severity: Major
Found in cs-lists/src/main/java/io/cloudslang/content/utils/StringMethod.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                        return ListProcessor.toString(ListProcessor.reverse(ListProcessor.sort(unsorted)), delimiter);
    Severity: Major
    Found in cs-lists/src/main/java/io/cloudslang/content/actions/ListSortAction.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                          return ListProcessor.toString(ListProcessor.sort(unsorted), delimiter);
      Severity: Major
      Found in cs-lists/src/main/java/io/cloudslang/content/actions/ListSortAction.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return getValue(jsonObject, aKey);

          Avoid too many return statements within this method.
          Open

                          return object.replaceAll("\\s+","");

            Avoid too many return statements within this function.
            Open

                      return getFailureResultsMap(validationStream.mkString(NEW_LINE))

              Avoid too many return statements within this function.
              Open

                        return getFailureResultsMap(validationStream.mkString(NEW_LINE))

                Avoid too many return statements within this function.
                Open

                          return getFailureResultsMap(validationStream.mkString(NEW_LINE))

                  Method setIdentity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static void setIdentity(JSch jsch, IdentityKey identityKey) throws SSHException {
                          byte[] passPhrase = identityKey.getPassPhrase();
                          if (identityKey instanceof KeyFile) {
                              try {
                                  jsch.addIdentity(((KeyFile) identityKey).getKeyFilePath(), passPhrase);

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

                      public static IdentityKey getIdentityKey(String privateKeyFile, String privateKeyString, String privateKeyPassphrase) {
                          IdentityKey identityKey = null;
                          if (StringUtilities.isNotEmpty(privateKeyFile)) {
                              identityKey = new KeyFile(privateKeyFile);
                          }

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

                      protected KeyFile getKeyFile(String privateKeyFile, String privateKeyPassPhrase) {
                          KeyFile keyFile = null;
                          if (privateKeyFile != null && !privateKeyFile.isEmpty()) {
                              if (privateKeyPassPhrase != null && !privateKeyPassPhrase.isEmpty()) {
                                  keyFile = new KeyFile(privateKeyFile, privateKeyPassPhrase);

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

                      public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) {
                          if (sessionParam != null) {
                              SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource();
                              if (resource != null) {
                                  Map<String, SSHConnection> tempMap = resource.get();
                  Severity: Minor
                  Found in cs-ssh/src/main/java/io/cloudslang/content/ssh/utils/CacheUtils.java - 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

                  Method getSshChannel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static Channel getSshChannel(SessionResource<Map<String, SSHConnection>> resource, String sessionId) {
                          if (resource != null) {
                              Object obj = resource.get();
                              if (obj != null) {
                                  SSHConnection sshConnection = (SSHConnection) ((Map) obj).get(sessionId);
                  Severity: Minor
                  Found in cs-ssh/src/main/java/io/cloudslang/content/ssh/utils/CacheUtils.java - 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

                  Method getSshSession has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static Session getSshSession(SessionResource<Map<String, SSHConnection>> resource, String sessionId) {
                          if (resource != null) {
                              Object obj = resource.get();
                              if (obj != null) {
                                  SSHConnection sshConnection = (SSHConnection) ((Map) obj).get(sessionId);
                  Severity: Minor
                  Found in cs-ssh/src/main/java/io/cloudslang/content/ssh/utils/CacheUtils.java - 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

                  Method isValidAttributesList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static boolean isValidAttributesList(String attributesList, String delimiter) {
                          if (attributesList == null || attributesList.isEmpty()) {
                              return false;
                          }
                          String[] attributeValuePairs = attributesList.split(delimiter+"\\s*");

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

                      private static List<File> iteration(String destination, Integer dpi, PDFRenderer renderer, List<File> fileList,
                                                          String fileName, Integer fromPage, Integer toPage, String pageIndex)
                              throws IOException {
                          if (!pageIndex.equals(EMPTY)) {
                              final String[] arrSplit = pageIndex.split(COMMA);

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

                      public static String extractTextFromImage(String filePath, String dataPath, String language, String textBlocks, String deskew) throws Exception {
                          String tempImagePath = null;
                          String result;
                          final TessBaseAPI api = new TessBaseAPI();
                  
                  

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

                      public static String getValue(String input) {
                          if (isBlank(input)) {
                              return NONE.getValue();
                          }
                  
                  

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

                      public static String getValue(String input) {
                          if (isBlank(input)) {
                              return VALUE_ONLY.getValue();
                          }
                  
                  

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

                      public static String copyConfigFiles(String toPath) throws Exception {
                          InputStream stream = null;
                          OutputStream resStreamOut = null;
                          final String jarFolder;
                          ZipFile zipFile = null;

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language