mohitgoyal91/azure-cosmosdb-querybuilder-java

View on GitHub

Showing 5 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

        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

        Severity
        Category
        Status
        Source
        Language