mtrevisan/HunLinter

View on GitHub

Showing 141 of 403 total issues

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

    public final Set<String> getSynonymsSet(){
        final Set<String> set = new HashSet<>(synonyms.size());
        for(int i = 0; i < synonyms.size(); i ++)
            set.addAll(synonyms.get(i).getSynonyms());
        return set;
src/main/java/io/github/mtrevisan/hunlinter/parsers/affix/AffixData.java on lines 161..166

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

    private List<String> getStringData(final List<AffixOption> keys){
        final List<String> strings = new ArrayList<>(keys.size());
        for(int i = 0; i < keys.size(); i ++)
            strings.add(getData(keys.get(i)));
        return strings;
src/main/java/io/github/mtrevisan/hunlinter/parsers/thesaurus/ThesaurusEntry.java on lines 106..111

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

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

            if(inflection.hasContinuationFlag(ruleAndRulesNotCombinableKeys[i])){
                final RuleMatcherEntry[] ruleMatcherEntries = ruleAndRulesNotCombinable.get(ruleAndRulesNotCombinableKeys[i]);
                for(int j = 0; j < ruleMatcherEntries.length; j ++)
                    ruleMatcherEntries[j].match(inflection);
            }
src/main/java/io/github/mtrevisan/hunlinter/languages/RulesLoader.java on lines 263..267
src/main/java/io/github/mtrevisan/hunlinter/languages/RulesLoader.java on lines 282..286

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

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(!StringUtils.containsAny(word, letterAndRulesCombinableKeys[i])){
                final LetterMatcherEntry[] letterMatcherEntries = letterAndRulesCombinable.get(letterAndRulesCombinableKeys[i]);
                for(int j = 0; j < letterMatcherEntries.length; j ++)
                    letterMatcherEntries[j].match(inflection);
            }
src/main/java/io/github/mtrevisan/hunlinter/languages/RulesLoader.java on lines 263..267
src/main/java/io/github/mtrevisan/hunlinter/languages/RulesLoader.java on lines 272..276

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

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(StringUtils.containsAny(word, letterAndRulesNotCombinableKeys[i])){
                final LetterMatcherEntry[] letterMatcherEntries = letterAndRulesNotCombinable.get(letterAndRulesNotCombinableKeys[i]);
                for(int j = 0; j < letterMatcherEntries.length; j ++)
                    letterMatcherEntries[j].match(inflection);
            }
src/main/java/io/github/mtrevisan/hunlinter/languages/RulesLoader.java on lines 272..276
src/main/java/io/github/mtrevisan/hunlinter/languages/RulesLoader.java on lines 282..286

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

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 final void createAutoCorrectLinterWorker(final Consumer<WorkerAbstract<?>> onStart, final Consumer<WorkerAbstract<?>> onEnd,
            final Consumer<Exception> onCancelled){
        final Supplier<WorkerAbstract<?>> creator = () -> new AutoCorrectLinterWorker(parserManager.getAcoParser(),
            parserManager.getLanguage(), parserManager.getDicParser(), parserManager.getWordGenerator(), onCancelled);
        createWorker(AutoCorrectLinterWorker.WORKER_NAME, creator, onStart, onEnd);
src/main/java/io/github/mtrevisan/hunlinter/workers/WorkerManager.java on lines 137..142

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

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 final void createThesaurusLinterWorker(final Consumer<WorkerAbstract<?>> onStart, final Consumer<WorkerAbstract<?>> onEnd,
            final Consumer<Exception> onCancelled){
        final Supplier<WorkerAbstract<?>> creator = () -> new ThesaurusLinterWorker(parserManager.getTheParser(), parserManager.getLanguage(),
            parserManager.getDicParser(), parserManager.getWordGenerator(), onCancelled);
        createWorker(ThesaurusLinterWorker.WORKER_NAME, creator, onStart, onEnd);
src/main/java/io/github/mtrevisan/hunlinter/workers/WorkerManager.java on lines 151..156

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

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 LetterMatcherEntry(final String messagePattern, final Character masterLetter, final String[] wrongFlags,
            final String correctRule){
        this.messagePattern = messagePattern;
        this.masterLetter = masterLetter;
        this.wrongFlags = wrongFlags;
src/main/java/io/github/mtrevisan/hunlinter/datastructures/dynamicarray/SuperBlock.java on lines 47..53

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

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

    private static String expandAliases(final String part, final List<String> aliases){
        return (aliases != null && !aliases.isEmpty() && NumberUtils.isCreatable(part)? aliases.get(Integer.parseInt(part) - 1): part);
    }
src/main/java/io/github/mtrevisan/hunlinter/parsers/vos/DictionaryEntryFactory.java on lines 116..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 49.

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

    private static String expandAliases(final String part, final List<String> aliases){
        return (aliases != null && !aliases.isEmpty() && NumberUtils.isCreatable(part)
            ? aliases.get(Integer.parseInt(part) - 1)
            : part);
    }
src/main/java/io/github/mtrevisan/hunlinter/parsers/vos/AffixEntry.java on lines 165..167

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

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 final void createAutoCorrectLinterFSAWorker(final Consumer<WorkerAbstract<?>> onStart, final Consumer<WorkerAbstract<?>> onEnd,
            final Consumer<Exception> onCancelled, final DictionaryLookup dictionaryLookup){
        final Supplier<WorkerAbstract<?>> creator = () -> new AutoCorrectLinterFSAWorker(parserManager.getAcoParser(),
            parserManager.getDicParser(), parserManager.getWordGenerator(), onCancelled, dictionaryLookup);
        createWorker(AutoCorrectLinterWorker.WORKER_NAME, creator, onStart, onEnd);
src/main/java/io/github/mtrevisan/hunlinter/workers/WorkerManager.java on lines 144..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 49.

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 void checkValidity(final String[] parts, final ParsingContext context){
        if(parts.length != 3)
            throw new LinterException(WRONG_FORMAT, context);
        if(!affixOption.is(parts[0]))
            throw new LinterException(BAD_OPTION, context, affixOption.getCode());
src/main/java/io/github/mtrevisan/hunlinter/parsers/affix/RelationTable.java on lines 88..93

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

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 final void createThesaurusLinterFSAWorker(final Consumer<WorkerAbstract<?>> onStart, final Consumer<WorkerAbstract<?>> onEnd,
            final Consumer<Exception> onCancelled, final DictionaryLookup dictionaryLookup){
        final Supplier<WorkerAbstract<?>> creator = () -> new ThesaurusLinterFSAWorker(parserManager.getTheParser(),
            parserManager.getDicParser(), parserManager.getWordGenerator(), onCancelled, dictionaryLookup);
        createWorker(ThesaurusLinterFSAWorker.WORKER_NAME, creator, onStart, onEnd);
src/main/java/io/github/mtrevisan/hunlinter/workers/WorkerManager.java on lines 158..163

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

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 void checkValidity(final String[] parts, final ParsingContext context){
        if(parts.length != 2)
            throw new LinterException(WRONG_FORMAT, context);
        if(!affixOption.is(parts[0]))
            throw new LinterException(BAD_OPTION, context, affixOption.getCode());
src/main/java/io/github/mtrevisan/hunlinter/parsers/affix/ConversionTable.java on lines 103..108

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

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 SuperBlock(final boolean even, final int maxNumberOfDataBlocks, final int maxNumberOfElementsPerBlock,
            final int numberOfDataBlocks){
        this.even = even;
        this.maxNumberOfDataBlocks = maxNumberOfDataBlocks;
        this.maxNumberOfElementsPerBlock = maxNumberOfElementsPerBlock;
src/main/java/io/github/mtrevisan/hunlinter/languages/LetterMatcherEntry.java on lines 41..47

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

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

        futureSaveResultFileChooser = JavaHelper.executeFuture(() -> {
            final JFileChooser saveResultFileChooser = new JFileChooser();
            saveResultFileChooser.setFileFilter(new FileNameExtensionFilter("Text files", "txt"));
            saveResultFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            return saveResultFileChooser;
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractDuplicatesAction.java on lines 75..80
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractMinimalPairsAction.java on lines 72..77
src/main/java/io/github/mtrevisan/hunlinter/gui/panes/PoSFSALayeredPane.java on lines 100..105
src/main/java/io/github/mtrevisan/hunlinter/gui/panes/ThesaurusLayeredPane.java on lines 117..122

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

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

        futureOpenPoSFSAFileChooser = JavaHelper.executeFuture(() -> {
            final JFileChooser openPoSDictionaryFileChooser = new JFileChooser();
            openPoSDictionaryFileChooser.setFileFilter(new FileNameExtensionFilter("FSA files", "dict"));
            openPoSDictionaryFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            return openPoSDictionaryFileChooser;
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractDuplicatesAction.java on lines 75..80
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractMinimalPairsAction.java on lines 72..77
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractWordlistAction.java on lines 79..84
src/main/java/io/github/mtrevisan/hunlinter/gui/panes/ThesaurusLayeredPane.java on lines 117..122

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

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

        futureSaveResultFileChooser = JavaHelper.executeFuture(() -> {
            final JFileChooser saveResultFileChooser = new JFileChooser();
            saveResultFileChooser.setFileFilter(new FileNameExtensionFilter("Text files", "txt"));
            saveResultFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            return saveResultFileChooser;
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractMinimalPairsAction.java on lines 72..77
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractWordlistAction.java on lines 79..84
src/main/java/io/github/mtrevisan/hunlinter/gui/panes/PoSFSALayeredPane.java on lines 100..105
src/main/java/io/github/mtrevisan/hunlinter/gui/panes/ThesaurusLayeredPane.java on lines 117..122

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

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

        futureOpenDictionaryFSAFileChooser = JavaHelper.executeFuture(() -> {
            final JFileChooser openPoSDictionaryFileChooser = new JFileChooser();
            openPoSDictionaryFileChooser.setFileFilter(new FileNameExtensionFilter("FSA files", "dict"));
            openPoSDictionaryFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            return openPoSDictionaryFileChooser;
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractDuplicatesAction.java on lines 75..80
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractMinimalPairsAction.java on lines 72..77
src/main/java/io/github/mtrevisan/hunlinter/actions/DictionaryExtractWordlistAction.java on lines 79..84
src/main/java/io/github/mtrevisan/hunlinter/gui/panes/PoSFSALayeredPane.java on lines 100..105

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

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

        final Function<Void, List<IndexDataPair<CorrectionEntry>>> step2 = ignored -> {
            resetProcessing("Execute " + workerData.getWorkerName() + " (step 2/2)");

            processLines(dataProcessor);

src/main/java/io/github/mtrevisan/hunlinter/workers/thesaurus/ThesaurusLinterWorker.java on lines 132..140

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

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

Severity
Category
Status
Source
Language