CloudSlang/cs-actions

View on GitHub
cs-excel/src/main/java/io/cloudslang/content/excel/services/GetRowIndexByConditionService.java

Summary

Maintainability
F
3 days
Test Coverage

Method getRowIndex has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

    private static String getRowIndex(final Sheet worksheet,
                                      final int firstRow,
                                      final String input,
                                      final int columnIndex,
                                      final String operator) {

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

    private static void processFormulaColumn(final Workbook excelDoc,
                                             final Sheet worksheet,
                                             final int firstRow,
                                             final int columnIndex) {

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

    public static double processValueInput(final String input) {
        double result = 0;

        //check if the input is in number format
        try {

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

    public static void getMergedCell(final Sheet sheet, final int firstRowIndex, final int cIndex) {
        final int countMRegion = sheet.getNumMergedRegions();

        for (int i = 0; i < countMRegion; i++) {
            CellRangeAddress range = sheet.getMergedRegion(i);

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 getRowIndex has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static String getRowIndex(final Sheet worksheet,
                                      final int firstRow,
                                      final String input,
                                      final int columnIndex,
                                      final String operator) {

    Method processValueInput has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static double processValueInput(final String input) {
            double result = 0;
    
            //check if the input is in number format
            try {

      Method getRowIndexbyCondition has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @NotNull
          public static Map<String, String> getRowIndexbyCondition(@NotNull final GetRowIndexByConditionInputs getRowIndexbyConditionInputs) {
              final Map<String, String> result;
              final Sheet worksheet;
              final Workbook excelDoc;

        Method processFormulaColumn has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static void processFormulaColumn(final Workbook excelDoc,
                                                     final Sheet worksheet,
                                                     final int firstRow,
                                                     final int columnIndex) {
        
        

          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 + ",";

            Avoid deeply nested control flow statements.
            Open

                                    switch (cellValue.getCellType()) {
                                        case BOOLEAN:
                                            cell.setCellType(CellType.STRING);
                                            break;
                                        case NUMERIC:

              Consider simplifying this complex logical expression.
              Open

                                          if ((cellFormat.equalsIgnoreCase("date") && inputFormat.equalsIgnoreCase("date")) ||
                                                  (cellFormat.equalsIgnoreCase("time") && inputFormat.equalsIgnoreCase("time")) ||
                                                  (cellFormat.equalsIgnoreCase("num") && inputFormat.equalsIgnoreCase("num"))) {
                                              if (compareNumericValue(cellValueNumeric, inputNumeric, operator)) {
                                                  result += i + ",";

                Method getRowIndex has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private static String getRowIndex(final Sheet worksheet,
                                                      final int firstRow,
                                                      final String input,
                                                      final int columnIndex,
                                                      final String operator) {

                  There are no issues that match your filters.

                  Category
                  Status