red6/dmn-check

View on GitHub

Showing 9 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) {
          Severity: Minor
          Found in validators/src/main/java/de/redsix/dmncheck/util/Util.java - About 1 hr to fix

            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)

              Function DmnCheckJsExtension has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function DmnCheckJsExtension(eventBus, drd, elementRegistry, moddle, overlays, canvas) {
              Severity: Minor
              Found in camunda-modeler-plugin/client/dmn-js-extension/DmnCheckJsExtension.js - About 45 mins to fix

                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) {
                Severity: Minor
                Found in validators/src/main/java/de/redsix/dmncheck/util/Util.java - About 35 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

                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);
                Severity: Minor
                Found in validators/src/main/java/de/redsix/dmncheck/util/Util.java - About 25 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Severity
                Category
                Status
                Source
                Language