Showing 11 of 11 total issues

File FontAwesome.java has 767 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package com.github.athi.athifx.gui.font_awesome;

import javafx.scene.control.Label;

import static com.github.athi.athifx.gui.configuration.ApplicationConfiguration.FONT_SIZE;

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

        private static void showPopup(String title, String message, FontAwesome iconFont, String color) {
            HEIGHT = DEFAULT_HEIGHT;
            changeHeightBasedOnMessage(message);
            
            Label titleLabel = new Label(title);

      Method invokeMethodWithAnnotation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          private void invokeMethodWithAnnotation(Object object, Class<? extends Annotation> annotation) {
              for (Method method : object.getClass().getDeclaredMethods()) {
                  if (method.isAnnotationPresent(annotation)) {
                      try {
                          if (!method.isAccessible()) {

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

          private static String namedExceptionMessage(String message) {
              String beginNamedMessageSubstring = message.substring(message.indexOf(NAMED_STRING));
              String fullNamedMessageSubstring = beginNamedMessageSubstring.substring(NAMED_STRING.length(), beginNamedMessageSubstring.indexOf(")"));
      
              if (fullNamedMessageSubstring.contains(INI_NAME)) {

      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

          private Function<List<AItem>, AItem> singleAItemFunction(long itemIdToValidate) {
              return aItems -> {
                  if (aItems.isEmpty()) {
                      throw new AMenuConfigurationException("Item with id: " + itemIdToValidate + " does not exist.");
                  } else if (aItems.size() == 1) {
      athi-fx-gui/src/main/java/com/github/athi/athifx/gui/menu/AMenu.java on lines 55..65

      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 64.

      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

          private Function<List<AGroup>, AGroup> singleAGroupFunction(long groupIdToValidate) {
              return aGroups -> {
                  if (aGroups.isEmpty()) {
                      throw new AMenuConfigurationException("Group with id: " + groupIdToValidate + " does not exist.");
                  } else if (aGroups.size() == 1) {
      athi-fx-gui/src/main/java/com/github/athi/athifx/gui/menu/AGroup.java on lines 110..120

      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 64.

      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

          private VBox createPasswordBox() {
              VBox passwordBox = new VBox();
              Node keyIcon = FontAwesome.labelIcon(FontAwesome.KEY);
              Label caption = new Label(PASSWORD_FIELD_CAPTION, keyIcon);
              passwordField = new PasswordField();
      athi-fx-gui/src/main/java/com/github/athi/athifx/gui/application/LoginScreen.java on lines 87..94

      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 61.

      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

          private VBox createLoginBox() {
              VBox loginBox = new VBox();
              Node userIcon = FontAwesome.labelIcon(FontAwesome.USER);
              Label caption = new Label(LOGIN_FIELD_CAPTION, userIcon);
              loginTextField = new TextField();
      athi-fx-gui/src/main/java/com/github/athi/athifx/gui/application/LoginScreen.java on lines 96..103

      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 61.

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

          static void setAnchors(Node child, Double left, Double top, Double right, Double bottom) {

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

            private void initConfigurationFiles(List<File> configurationFiles) {
                for (File configurationFile : configurationFiles) {
                    String name = configurationFile.getName();
                    try {
                        URL url = configurationFile.toURI().toURL();

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

            @PostConstruct
            private void initMenu() {
                setPrefWidth(200);
                setPadding(Insets.EMPTY);
        
        
        Severity: Minor
        Found in athi-fx-gui/src/main/java/com/github/athi/athifx/gui/menu/Menu.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

        Severity
        Category
        Status
        Source
        Language