sah4ez/erp_vaadin_framework

View on GitHub

Showing 18 of 32 total issues

Workspace has 58 methods (exceeds 20 allowed). Consider refactoring.
Open

abstract public class Workspace extends CssLayout implements PermissionAccessUI {
    private Logic logic;

    private Float splitPosition = 50f;

Severity: Major
Found in core/src/main/java/com/github/sah4ez/core/elements/Workspace.java - About 1 day to fix

    FilterPanel has 35 methods (exceeds 20 allowed). Consider refactoring.
    Open

    abstract public class FilterPanel extends VerticalLayout {
        private ComboBox column;
        private TextField text;
        private Button add;
        private Table table;
    Severity: Minor
    Found in core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java - About 4 hrs to fix

      MenuNavigator has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

      abstract public class MenuNavigator extends MenuBar implements PermissionAccessUI {
      
          private String identify = "";
      
          private ModifierAccess permissionAccess = ModifierAccess.HIDE;
      Severity: Minor
      Found in core/src/main/java/com/github/sah4ez/core/elements/MenuNavigator.java - About 3 hrs to fix

        File Workspace.java has 307 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        package com.github.sah4ez.core.elements;
        
        import com.github.sah4ez.core.data.TreeDataContainer;
        import com.github.sah4ez.core.permission.ModifierAccess;
        import com.github.sah4ez.core.permission.PermissionAccess;
        Severity: Minor
        Found in core/src/main/java/com/github/sah4ez/core/elements/Workspace.java - About 3 hrs to fix

          CrossTable has 25 methods (exceeds 20 allowed). Consider refactoring.
          Open

          abstract public class CrossTable extends Workspace {
          
              private DataContainer<? extends Entity> firstContainer;
              private DataContainer<? extends Entity> secondContainer;
              private String idFirst = "";
          Severity: Minor
          Found in core/src/main/java/com/github/sah4ez/core/elements/CrossTable.java - About 2 hrs to fix

            File FilterPanel.java has 274 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            package com.github.sah4ez.core.elements;
            
            import com.github.sah4ez.core.data.DataContainer;
            import com.github.sah4ez.core.data.TreeDataContainer;
            import com.vaadin.data.Container;
            Severity: Minor
            Found in core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java - About 2 hrs to fix

              DataContainer has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              abstract public class DataContainer<T extends Entity> extends BeanItemContainer<T> {
              
                  private final ArrayList<String> headers = new ArrayList<>();
                  private ArrayList<String> captions = new ArrayList<>();
                  private ArrayList<Boolean> visible = new ArrayList<>();
              Severity: Minor
              Found in core/src/main/java/com/github/sah4ez/core/data/DataContainer.java - About 2 hrs to fix

                Method getContainer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected DataContainer getContainer() {
                        DataContainer container = null;
                        TreeDataContainer treeContainer = null;
                
                        if (tableIsNotNull()) {
                Severity: Minor
                Found in core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java - About 1 hr 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 createData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void createData(String idFirst, String captionFirst, String idSecond, String captionSecond) {
                        this.idFirst = idFirst;
                        this.captionFirst = captionFirst;
                        this.idSecond = idSecond;
                        this.captionSecond = captionSecond;
                Severity: Minor
                Found in core/src/main/java/com/github/sah4ez/core/elements/CrossTable.java - About 1 hr to fix

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

                      public void loadColumns() {
                          if (table != null) column.addItems(table.getVisibleColumns());
                          if (filterTable != null) column.addItems(filterTable.getVisibleColumns());
                          if (filterTreeTable != null) column.addItems(filterTreeTable.getVisibleColumns());
                  
                  
                  Severity: Minor
                  Found in core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java - About 45 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 sortable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void sortable() {
                          if (sortColumn.size() > 0) {
                  
                              DataContainer container = getContainer();
                              boolean[] booleanArray = new boolean[sortAscending.size()];
                  Severity: Minor
                  Found in core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java - About 45 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 equals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      @Override
                      public boolean equals(Object o) {
                          if (this == o) return true;
                          if (o == null || getClass() != o.getClass()) return false;
                          Element element = (Element) o;
                  Severity: Minor
                  Found in src/main/java/com/github/sah4ez/example/data/Element.java - About 35 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 getChildren has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      @Override
                      public Collection<?> getChildren(Object itemId) {
                          ArrayList<Object> children = new ArrayList<>();
                  
                          //TODO: Find new implementation
                  Severity: Minor
                  Found in core/src/main/java/com/github/sah4ez/core/data/TreeDataContainer.java - About 35 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 rootItemIds has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      @Override
                      public Collection<?> rootItemIds() {
                          ArrayList<Object> result = new ArrayList<>();
                          for (Object candidateId : getItemIds()) {
                              Object parentRef = null;
                  Severity: Minor
                  Found in core/src/main/java/com/github/sah4ez/core/data/TreeDataContainer.java - About 35 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 multiCellInColumnAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private void multiCellInColumnAction(Item item, Object property){
                          if (contains(item, property)) {
                              setPrevValue(item, property);
                              remove(item, property);
                          } else if (!selectedCell.containsKey(item) && !selectedCell.isEmpty()) {
                  Severity: Minor
                  Found in core/src/main/java/com/github/sah4ez/core/elements/CrossTable.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 replacePermissionAccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static void replacePermissionAccess(Map<String, ModifierAccess> map, String name, ModifierAccess newValue) {
                          switch (map.get(name)) {
                              case EDIT: {
                                  if (newValue.equals(ModifierAccess.HIDE) || newValue.equals(ModifierAccess.READ)) break;
                                  map.replace(name, newValue);

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

                      private CustomTable.CellStyleGenerator cellStyleGenerator() {
                          return (CustomTable.CellStyleGenerator) (customTable, itemId, property) -> {
                              if (customTable == null || itemId == null || property == null) return null;
                  
                              String result = null;
                  Severity: Minor
                  Found in core/src/main/java/com/github/sah4ez/core/elements/CrossTable.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 replacePermissionAccess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static void replacePermissionAccess(PermissionAccessUI component, ModifierAccess newValue) {
                          switch (component.getModifierAccess()) {
                              case EDIT: {
                                  if (newValue.equals(ModifierAccess.HIDE) || newValue.equals(ModifierAccess.READ)) break;
                                  component.setModifierAccess(newValue);

                  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