mohitgoyal91/azure-cosmosdb-querybuilder-java

View on GitHub

Showing 347 of 347 total issues

SelectQuery has 60 methods (exceeds 20 allowed). Consider refactoring.
Open

public class SelectQuery extends RestrictionExtractor implements AggregateExtractorMin {

    private SelectQueryType type;
    private Integer limit;
    private Columns columns = new Columns();

    File SelectQuery.java has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package com.github.mohitgoyal91.cosmosdbqueryutils;
    
    import com.github.mohitgoyal91.cosmosdbqueryutils.Aggregate.AggregateExtractorMin;
    import com.github.mohitgoyal91.cosmosdbqueryutils.Aggregate.AggregateFunction;
    import com.github.mohitgoyal91.cosmosdbqueryutils.QueryProcessor.Processor;

      RestrictionBuilder has 24 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class RestrictionBuilder extends RestrictionExtractor {
      
          /**
           * To create query with id restriction
           * @param id id of the document to be fetched

        Method filterRestrictions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public static void filterRestrictions(List<GroupedRestriction> groupedRestrictions) {
                List<GroupedRestriction> _groupedRestrictions = new ArrayList<>();
                List<GroupedRestriction> groupedRestrictionListestrictionList = groupedRestrictions;
        
                for (GroupedRestriction groupedRestriction : groupedRestrictionListestrictionList){

        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

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

            @Override
            public void addRestriction(String propertyName, Object value, String comparator) {
                if(value instanceof Optional){
                    if(((Optional) value).isPresent()){
                        this.restrictionExpressionList.add(new ArrayRestrictionExpression(propertyName, ((Optional) value).get(), comparator, Constants.Operators.Logical.AND));
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 87..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 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 2 locations. Consider refactoring.
        Open

            @Override
            public void addRestriction(String propertyName, Object value, String comparator) {
                if(value instanceof Optional){
                    if(((Optional) value).isPresent()){
                        this.restrictionExpressionList.add(new ComparisonRestrictionExpression(propertyName, ((Optional) value).get(), comparator, Constants.Operators.Logical.AND));
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 23..32

        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

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

            @Override
            public ComparisonRestriction or(){
                if(this.restrictionExpressionList.size() > 0){
                    ((ComparisonRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.OR);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public ArithmeticRestriction and() {
                if(this.restrictionExpressionList.size() > 0){
                    ((ArithmeticRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.AND);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public ArrayRestriction and() {
                if(this.restrictionExpressionList.size() > 0){
                    ((ArrayRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.AND);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public TypeCheckRestriction or() {
                if(this.restrictionExpressionList.size() > 0){
                    ((TypeCheckRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.OR);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39

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

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

            @Override
            public ArrayRestriction or() {
                if(this.restrictionExpressionList.size() > 0){
                    ((ArrayRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.OR);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public TypeCheckRestriction and() {
                if(this.restrictionExpressionList.size() > 0){
                    ((TypeCheckRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.AND);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public Restriction or() {
                if(this.restrictionExpressionList.size() > 0){
                    ((ArithmeticRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.OR);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public INRestriction or() {
                if(this.restrictionExpressionList.size() > 0){
                    ((INRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.OR);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public INRestriction and() {
                if(this.restrictionExpressionList.size() > 0){
                    ((INRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.AND);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 102..108
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

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

            @Override
            public ComparisonRestriction and(){
                if(this.restrictionExpressionList.size() > 0){
                    ((ComparisonRestrictionExpression) RestrictionHelper.getLastElementFromList(this.getRestrictionExpressionList())).setLogicalCombiner(Constants.Operators.Logical.AND);
                }
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 110..116
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArithmeticRestriction.java on lines 122..128
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 34..40
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ArrayRestriction.java on lines 42..48
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/ComparisonRestriction.java on lines 114..120
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 61..67
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/INRestriction.java on lines 73..79
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.java on lines 33..39
        src/main/java/com/github/mohitgoyal91/cosmosdbqueryutils/restriction/TypeCheckRestriction.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 45.

        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 addRestrictions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public SelectQuery addRestrictions(Restriction... restrictions){
                if(Optional.ofNullable(restrictions).isPresent()){
                    List<Restriction> _restrictions = new ArrayList<>();
                    for(Restriction restriction : restrictions){
                        if(Optional.ofNullable(restriction).isPresent()){

        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

        First sentence of Javadoc is missing an ending period.
        Open

            /**

        Checks thatJavadoc summary sentence does not contain phrases that are not recommended to use.Summaries that contain only the {@inheritDoc} tag are skipped. Check alsoviolate Javadoc that does not contain first sentence.

        This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

        First sentence of Javadoc is missing an ending period.
        Open

            /**

        Checks thatJavadoc summary sentence does not contain phrases that are not recommended to use.Summaries that contain only the {@inheritDoc} tag are skipped. Check alsoviolate Javadoc that does not contain first sentence.

        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 133).
        Open

            public static void appendRestrictionExpression(TypeCheckRestrictionExpression restrictionExpression, StringBuilder queryBuilder){

        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.

        Severity
        Category
        Status
        Source
        Language