Showing 324 of 324 total issues
Function DmnCheckJsExtension
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DmnCheckJsExtension(eventBus, drd, elementRegistry, moddle, overlays, canvas) {
const messages = document.createElement("div");
messages.classList.add('message-box');
messages.id = "message-box";
Method TOKENIZER
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Parser<?> TOKENIZER(Collection<ItemDefinition> itemDefinitions) {
final Parser<?> itemDefinitionTokenizer = itemDefinitions.stream()
.map(NamedElement::getName)
.filter(Objects::nonNull)
.map(name -> Patterns.string(name)
Method main
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static void main(String[] args) {
final ValidationServer validationServer = new ValidationServer();
final Logger logger = LoggerFactory.getLogger(ValidationServer.class);
Function validate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validate() {
const map = {};
moddle.toXML(drd._definitions, {}, (err, xml) => {
log("Start validation.");
Method zip
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static <A, B, C, D> Stream<D> zip(
final Stream<? extends A> a,
final Stream<? extends B> b,
final Stream<? extends C> c,
final TriFunction<? super A, ? super B, ? super C, ? extends D> zipper) {
Method validate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public List<ValidationResult> validate(ItemDefinition itemDefinition, ValidationContext validationContext) {
final Collection<ItemDefinition> itemDefinitionsAndComponents = itemDefinition.getItemComponents().stream()
.filter(itemComponent -> itemComponent.getAllowedValues() != null)
Similar blocks of code found in 2 locations. Consider refactoring. Open
return ExpressionTypeParser.parse(expressionType, validationContext.getItemDefinitions())
.match(
validationResult -> Collections.singletonList(
validationResult.element(input).build()),
inputType -> typecheck(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 64.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
return ExpressionTypeParser.parse(expressionType, validationContext.getItemDefinitions())
.match(
validationResult -> Collections.singletonList(
validationResult.element(output).build()),
inputType -> typecheck(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 64.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function DmnCheckJsExtension
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function DmnCheckJsExtension(eventBus, drd, elementRegistry, moddle, overlays, canvas) {
Method zip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static <A, B, C, D> Stream<D> zip(
final Stream<? extends A> a,
final Stream<? extends B> b,
final Stream<? extends C> c,
final TriFunction<? super A, ? super B, ? super C, ? extends D> zipper) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method zip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static <A, B, C> Stream<C> zip(
final Stream<? extends A> a,
final Stream<? extends B> b,
final BiFunction<? super A, ? super B, ? extends C> zipper) {
Objects.requireNonNull(zipper);
- Read upRead up
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
Wrong lexicographical order for 'java.nio.charset.StandardCharsets' import. Should be before 'spark.Spark.post'. Open
import java.nio.charset.StandardCharsets;
- Read upRead up
- Exclude checks
Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Line is longer than 100 characters (found 101). Open
return Files.walk(dir).filter(Files::isRegularFile).filter(matcher::matches);
- Read upRead up
- Exclude checks
Checks for long lines.
Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Line is longer than 100 characters (found 114). Open
final String errorMessage = "Element '" + delegate(validationResult.getElement()) + "'" + " of type '"
- Read upRead up
- Exclude checks
Checks for long lines.
Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Line is longer than 100 characters (found 102). Open
c -> getLogger().info((String) c), c -> getLogger().warn((String) c), c -> getLogger()
- Read upRead up
- Exclude checks
Checks for long lines.
Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Line is longer than 100 characters (found 108). Open
Patterns.regex("^-$").toScanner("empty").source().map(s -> Tokens.fragment(s, "emptyfragment")),
- Read upRead up
- Exclude checks
Checks for long lines.
Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Line is longer than 100 characters (found 115). Open
public static Either<ValidationResult.Builder.ElementStep, FeelExpression> parse(final Expression expression) {
- Read upRead up
- Exclude checks
Checks for long lines.
Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Line is longer than 100 characters (found 120). Open
Operator.NOT.equals(operator) ? subsumesVariableLiteral(name, operand, nq) : Optional.of(true)))
- Read upRead up
- Exclude checks
Checks for long lines.
Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Wrong lexicographical order for 'de.redsix.dmncheck.result.ValidationResult' import. Should be before 'de.redsix.dmncheck.util.Eithers.right'. Open
import de.redsix.dmncheck.result.ValidationResult;
- Read upRead up
- Exclude checks
Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.
Wrong lexicographical order for 'java.util.stream.Collectors' import. Should be before 'spark.Spark.post'. Open
import java.util.stream.Collectors;
- Read upRead up
- Exclude checks
Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.
This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.