sah4ez/erp_vaadin_framework

View on GitHub

Showing 32 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

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                            element3DataContainer =
                                    new DataContainer<Element3>(Element3.class) {
                                        @Override
                                        protected void initHeaders() {
                                            addCaption("id", "name", "price");
                src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 122..139

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 106.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                            element2DataContainer =
                                    new DataContainer<Element2>(Element2.class) {
                                        @Override
                                        protected void initHeaders() {
                                            addCaption("id", "name", "price");
                src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 140..157

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 106.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      protected void ascSortListener(Button.ClickEvent event){
                          if (!filters.isVisible())
                              filters.setVisible(true);
                  
                          Button btnAsc = filterButton(": по возрастанию");
                  core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java on lines 123..132

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      protected void descSortListener(Button.ClickEvent event){
                          if (!filters.isVisible())
                              filters.setVisible(true);
                  
                          Button btnDesc = filterButton(": по убыванию");
                  core/src/main/java/com/github/sah4ez/core/elements/FilterPanel.java on lines 141..150

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 60.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                      private static class Element4 {
                          private Integer id = 0;
                          private String name = "";
                          private Float price = 0.0F;
                  
                  
                  src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 161..171
                  src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 173..183

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 58.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                      private static class Element3 {
                          private Integer id = 0;
                          private String name = "";
                          private Float price = 0.0F;
                  
                  
                  src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 161..171
                  src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 185..195

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 58.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                      private static class Element2 {
                          private Integer id = 0;
                          private String name = "";
                          private Float price = 0.0F;
                  
                  
                  src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 173..183
                  src/main/java/com/github/sah4ez/example/layout/CrossTableLayout.java on lines 185..195

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 58.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      public void editOn() {
                          mode = Mode.CHANGE;
                          getTable().removeItemClickListener(selectItemClickListener);
                          getTableAll().removeItemClickListener(selectItemClickListenerAll);
                  
                  
                  core/src/main/java/com/github/sah4ez/core/elements/Workspace.java on lines 340..347

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 45.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language