workcraft/workcraft

View on GitHub
workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java

Summary

Maintainability
F
4 days
Test Coverage

Avoid deeply nested control flow statements.
Open

                        if (rstr.equals(st)) {
                            vqc.setForegroundColor(Color.RED);
                        }

    Avoid deeply nested control flow statements.
    Open

                            if (rstr.equals(ql.name)) {
                                vqc.setForegroundColor(Color.GREEN);
                            }

      Avoid deeply nested control flow statements.
      Open

                              if (node instanceof VisualQueueComponent) {
                                  vqc = (VisualQueueComponent) node;
                                  qc = vqc.getReferencedComponent();
                                  //System.out.println("x===" + xnet.getName(qc));
                                  String rstr;

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

            public void relHighlight(String s, Xmas xnet, VisualXmas vnet) {
                int typ = 0;
                String str = "";
                QueueComponent qc;
                SyncComponent sc;
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 242..311

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

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

                while (sc.hasNextLine()) {
                    Scanner line = new Scanner(sc.nextLine());
                    Scanner nxt = new Scanner(line.next());
                    String check = nxt.next();
                    String str;
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 77..114
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 70..107

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

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

            public void localHighlight(String s, Xmas xnet, VisualXmas vnet) {
                QueueComponent qc;
                SyncComponent sc;
                VisualQueueComponent vqc;
                VisualSyncComponent vsc;
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 205..240
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 194..229

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

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

            public void activeHighlight(Xmas xnet, VisualXmas vnet) {
                QueueComponent qc;
                SyncComponent sc;
                VisualQueueComponent vqc;
                VisualSyncComponent vsc;
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 313..344
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 305..336

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

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

            private static void processQsl(String file) {
                qslist.clear();
                Scanner sc = null;
                try {
                    sc = new Scanner(new File(file));
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 142..160
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 131..149

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

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

            public void initHighlight(Xmas xnet, VisualXmas vnet) {
                VisualQueueComponent vqc;
                VisualSyncComponent vsc;
        
                for (Node node : vnet.getNodes()) {
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 190..203
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 179..192

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

        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

            private static String processQue(String file) {
                Scanner sc = null;
                try {
                    sc = new Scanner(new File(file));
                } catch (FileNotFoundException e) {
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 126..140
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 162..176
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 155..169
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 191..205
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 115..129
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 151..165

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

        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

            private static String processLoc(String file) {
                Scanner sc = null;
                try {
                    sc = new Scanner(new File(file));
                } catch (FileNotFoundException e) {
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 126..140
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 162..176
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 191..205
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 207..221
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 115..129
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 151..165

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

        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

            private static String processEq(String file) {
                Scanner sc = null;
                try {
                    sc = new Scanner(new File(file));
                } catch (FileNotFoundException e) {
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 126..140
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 162..176
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 155..169
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 207..221
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 115..129
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 151..165

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

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

                ItemListener itemListener2 = new ItemListener() {
                    @Override
                    public void itemStateChanged(ItemEvent e) {
                        if (e.getSource() instanceof JCheckBox) {
                            JCheckBox sjcb = (JCheckBox) e.getSource();
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 452..467
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 499..514

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

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

                ItemListener itemListener = new ItemListener() {
                    @Override
                    public void itemStateChanged(ItemEvent e) {
                        if (e.getSource() instanceof JCheckBox) {
                            JCheckBox sjcb = (JCheckBox) e.getSource();
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 452..467
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 476..491

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

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

                ItemListener itemListener1 = new ItemListener() {
                    @Override
                    public void itemStateChanged(ItemEvent e) {
                        if (e.getSource() instanceof JCheckBox) {
                            JCheckBox sjcb = (JCheckBox) e.getSource();
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 476..491
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasQueryTool.java on lines 499..514

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

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

                            while ((s = stdInput.readLine()) != null) {
                                if (test == -1) test = checkType(s);
                                if (n > 0) str += s + '\n';
                                n++;
                                System.out.println(s);
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 480..486
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 369..374

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

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

                                if (test == 2) {
                                    if ("local".equals(highlight)) {
                                        localHighlight(str, xnet, vnet);
                                    } else if ("rel".equals(highlight)) {
                                        relHighlight(str, xnet, vnet);
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 507..514
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 395..403

        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

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

            public int checkType(String s) {
        
                if (s.contains("DEADLOCK FREE")) {
                    return 0;
                } else if (s.contains("TRACE FOUND")) {
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasAnalysisTool.java on lines 178..188
        workcraft/XmasPlugin/src/org/workcraft/plugins/xmas/tools/XmasVerificationTool.java on lines 167..177

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

        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

        There are no issues that match your filters.

        Category
        Status