cbrnrd/AlertFX

View on GitHub

Showing 15 of 15 total issues

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

    public void show(){
        alert.initStyle(style);
        alert.setTitle("Exception Caught!");
        alert.setHeaderText("Exception encountered");
        alert.setContentText(error.getMessage());
Severity: Major
Found in src/main/java/org/cbrnrd/alertfx/ErrorBox.java and 1 other location - About 3 hrs to fix
src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 101..131

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

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

    public void showNonblock(){
        alert.initStyle(style);
        alert.setTitle("Exception Caught!");
        alert.setHeaderText("Exception encountered");
        alert.setContentText(error.getMessage());
Severity: Major
Found in src/main/java/org/cbrnrd/alertfx/ErrorBox.java and 1 other location - About 3 hrs to fix
src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 65..96

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

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

    public Optional<Pair<String, String>> show(){
        alert = new Dialog<>();
        alert.setTitle(title);
        alert.setHeaderText(header);

Severity: Minor
Found in src/main/java/org/cbrnrd/alertfx/Login.java - About 1 hr to fix

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

        public void applyCss(String path){
            if (alert.isShowing()){
                throw new AlertNotEditableException("Alert not editable while it is showing");
            }
            DialogPane dialogPane = alert.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/ErrorBox.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ChoiceBox.java on lines 30..37
    src/main/java/org/cbrnrd/alertfx/ConfirmExit.java on lines 46..53
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 85..92
    src/main/java/org/cbrnrd/alertfx/Prompt.java on lines 37..44
    src/main/java/org/cbrnrd/alertfx/QuestionBox.java on lines 61..68
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 55..62

    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 7 locations. Consider refactoring.
    Open

        public void applyCss(String path){
            if (alert.isShowing()){
                throw new AlertNotEditableException("Alert not editable while it is showing");
            }
            DialogPane dialogPane = alert.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/Warn.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ChoiceBox.java on lines 30..37
    src/main/java/org/cbrnrd/alertfx/ConfirmExit.java on lines 46..53
    src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 53..60
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 85..92
    src/main/java/org/cbrnrd/alertfx/Prompt.java on lines 37..44
    src/main/java/org/cbrnrd/alertfx/QuestionBox.java on lines 61..68

    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 7 locations. Consider refactoring.
    Open

        public void applyCss(String path){
            if (alert.isShowing()){
                throw new AlertNotEditableException("Alert not editable while it is showing");
            }
            DialogPane dialogPane = alert.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/ConfirmExit.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ChoiceBox.java on lines 30..37
    src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 53..60
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 85..92
    src/main/java/org/cbrnrd/alertfx/Prompt.java on lines 37..44
    src/main/java/org/cbrnrd/alertfx/QuestionBox.java on lines 61..68
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 55..62

    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 7 locations. Consider refactoring.
    Open

        public void applyCss(String path){
            if (alert.isShowing()){
                throw new AlertNotEditableException("Alert not editable while it is showing");
            }
            DialogPane dialogPane = alert.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/Prompt.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ChoiceBox.java on lines 30..37
    src/main/java/org/cbrnrd/alertfx/ConfirmExit.java on lines 46..53
    src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 53..60
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 85..92
    src/main/java/org/cbrnrd/alertfx/QuestionBox.java on lines 61..68
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 55..62

    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 7 locations. Consider refactoring.
    Open

        public void applyCss(String path){
            if (alert.isShowing()){
                throw new AlertNotEditableException("Alert not editable while it is showing");
            }
            DialogPane dialogPane = alert.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/QuestionBox.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ChoiceBox.java on lines 30..37
    src/main/java/org/cbrnrd/alertfx/ConfirmExit.java on lines 46..53
    src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 53..60
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 85..92
    src/main/java/org/cbrnrd/alertfx/Prompt.java on lines 37..44
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 55..62

    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 7 locations. Consider refactoring.
    Open

        public void applyCss(String path){
            if (alert.isShowing()){
                throw new AlertNotEditableException("Alert not editable while it is showing");
            }
            DialogPane dialogPane = alert.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/ChoiceBox.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ConfirmExit.java on lines 46..53
    src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 53..60
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 85..92
    src/main/java/org/cbrnrd/alertfx/Prompt.java on lines 37..44
    src/main/java/org/cbrnrd/alertfx/QuestionBox.java on lines 61..68
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 55..62

    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 7 locations. Consider refactoring.
    Open

        public void applyCss(String path){
            if (dialog.isShowing()) {
                throw new AlertNotEditableException("Unable to edit alert while it is being shown");
            }
            DialogPane dialogPane = dialog.getDialogPane();
    Severity: Major
    Found in src/main/java/org/cbrnrd/alertfx/MsgBox.java and 6 other locations - About 50 mins to fix
    src/main/java/org/cbrnrd/alertfx/ChoiceBox.java on lines 30..37
    src/main/java/org/cbrnrd/alertfx/ConfirmExit.java on lines 46..53
    src/main/java/org/cbrnrd/alertfx/ErrorBox.java on lines 53..60
    src/main/java/org/cbrnrd/alertfx/Prompt.java on lines 37..44
    src/main/java/org/cbrnrd/alertfx/QuestionBox.java on lines 61..68
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 55..62

    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

        public void show(){
            dialog = new Alert(type);
            dialog.setTitle("Alert");
            dialog.setContentText(msg);
            dialog.setResizable(false);
    Severity: Minor
    Found in src/main/java/org/cbrnrd/alertfx/MsgBox.java and 1 other location - About 40 mins to fix
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 109..116

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

    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

        public void showNonblock(){
            dialog = new Alert(type);
            dialog.setTitle("Alert");
            dialog.setContentText(msg);
            dialog.setResizable(false);
    Severity: Minor
    Found in src/main/java/org/cbrnrd/alertfx/MsgBox.java and 1 other location - About 40 mins to fix
    src/main/java/org/cbrnrd/alertfx/MsgBox.java on lines 97..104

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

    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

        public void show(){
            Alert alert = new Alert(Alert.AlertType.WARNING);
            alert.initStyle(style);
            alert.setContentText(warning);
            alert.setHeaderText(header);
    Severity: Minor
    Found in src/main/java/org/cbrnrd/alertfx/Warn.java and 1 other location - About 35 mins to fix
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 78..84

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

    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

        public void showNonblock(){
            Alert alert = new Alert(Alert.AlertType.WARNING);
            alert.initStyle(style);
            alert.setContentText(warning);
            alert.setHeaderText(header);
    Severity: Minor
    Found in src/main/java/org/cbrnrd/alertfx/Warn.java and 1 other location - About 35 mins to fix
    src/main/java/org/cbrnrd/alertfx/Warn.java on lines 67..73

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

    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

    Function show has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function show(type)
    {
        count = 0;
        for (var key in methods) {
            var row = document.getElementById(key);
    Severity: Minor
    Found in docs/script.js - 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