kschuetz/enhanced-iterables

View on GitHub

Showing 25 of 25 total issues

EnhancedIterables has 49 methods (exceeds 20 allowed). Consider refactoring.
Open

final class EnhancedIterables {
    private static final ImmutableFiniteIterable<?> EMPTY = () -> protectedIterator(Collections.emptyIterator());

    private EnhancedIterables() {
    }
Severity: Minor
Found in src/main/java/software/kes/enhancediterables/EnhancedIterables.java - About 6 hrs to fix

    FiniteIterable has 36 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public interface FiniteIterable<A> extends EnhancedIterable<A> {
    
        /**
         * Lazily appends an element to the end of this {@code FiniteIterable}, yielding a new {@code NonEmptyFiniteIterable}.
         *
    Severity: Minor
    Found in src/main/java/software/kes/enhancediterables/FiniteIterable.java - About 4 hrs to fix

      File EnhancedIterables.java has 343 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package software.kes.enhancediterables;
      
      import com.jnape.palatable.lambda.adt.Maybe;
      import com.jnape.palatable.lambda.functions.builtin.fn1.Cycle;
      import com.jnape.palatable.lambda.functions.builtin.fn1.Distinct;
      Severity: Minor
      Found in src/main/java/software/kes/enhancediterables/EnhancedIterables.java - About 4 hrs to fix

        EnhancedIterable has 33 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public interface EnhancedIterable<A> extends Iterable<A>, Functor<A, EnhancedIterable<?>> {
        
            /**
             * Lazily appends an element to the end of this {@code EnhancedIterable}, yielding a new {@code NonEmptyIterable}.
             *
        Severity: Minor
        Found in src/main/java/software/kes/enhancediterables/EnhancedIterable.java - About 4 hrs to fix

          ImmutableFiniteIterable has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public interface ImmutableFiniteIterable<A> extends ImmutableIterable<A>, FiniteIterable<A> {
          
              /**
               * Lazily appends an element to the end of this {@code ImmutableFiniteIterable}, yielding a new {@code ImmutableNonEmptyFiniteIterable}.
               *

            ImmutableIterable has 27 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public interface ImmutableIterable<A> extends EnhancedIterable<A> {
            
                /**
                 * Lazily appends an element to the end of this {@code ImmutableIterable}, yielding a new {@code ImmutableNonEmptyIterable}.
                 *
            Severity: Minor
            Found in src/main/java/software/kes/enhancediterables/ImmutableIterable.java - About 3 hrs to fix

              NonEmptyFiniteIterable has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public interface NonEmptyFiniteIterable<A> extends FiniteIterable<A>, NonEmptyIterable<A> {
              
                  /**
                   * Returns an {@code FiniteIterable} containing all subsequent elements of this one beyond the first.
                   *

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

                    static <A> NonEmptyIterable<A> unsafeNonEmptyIterable(Iterable<A> underlying) {
                        if (underlying instanceof NonEmptyIterable<?>) {
                            return (NonEmptyIterable<A>) underlying;
                        } else if (underlying instanceof Collection<?>) {
                            return NonEmptyCollectionWrapper.wrap((Collection<A>) underlying);
                src/main/java/software/kes/enhancediterables/EnhancedIterables.java on lines 152..162

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

                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

                    static <A> ImmutableNonEmptyIterable<A> unsafeImmutableNonEmptyIterable(Iterable<A> underlying) {
                        if (underlying instanceof ImmutableNonEmptyIterable<?>) {
                            return (ImmutableNonEmptyIterable<A>) underlying;
                        } else if (underlying instanceof Collection<?>) {
                            return ImmutableNonEmptyCollectionWrapper.wrap((Collection<A>) underlying);
                src/main/java/software/kes/enhancediterables/EnhancedIterables.java on lines 140..150

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

                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

                package software.kes.enhancediterables;
                
                import com.jnape.palatable.lambda.functions.builtin.fn1.Tail;
                
                import java.util.Collection;
                src/main/java/software/kes/enhancediterables/ImmutableNonEmptyCollectionWrapper.java on lines 1..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 60.

                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

                package software.kes.enhancediterables;
                
                import com.jnape.palatable.lambda.functions.builtin.fn1.Tail;
                
                import java.util.Collection;
                src/main/java/software/kes/enhancediterables/NonEmptyCollectionWrapper.java on lines 1..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 60.

                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

                    static <A> Maybe<NonEmptyFiniteIterable<A>> nonEmptyMaybeFinite(A head, Iterable<A> tail) {
                        if (tail instanceof FiniteIterable<?>) {
                            return just(nonEmptyFiniteIterable(head, (FiniteIterable<A>) tail));
                        } else if (tail instanceof Collection<?>) {
                            return just(nonEmptyFiniteIterable(head, finiteIterable(tail)));
                src/main/java/software/kes/enhancediterables/EnhancedIterables.java on lines 106..114

                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

                    static <A> Maybe<ImmutableNonEmptyFiniteIterable<A>> immutableNonEmptyMaybeFinite(A head, Iterable<A> tail) {
                        if (tail instanceof ImmutableFiniteIterable<?>) {
                            return just(immutableNonEmptyFiniteIterable(head, (ImmutableFiniteIterable<A>) tail));
                        } else if (tail instanceof Collection<?>) {
                            return just(immutableNonEmptyFiniteIterable(head, immutableFiniteIterable(tail)));
                src/main/java/software/kes/enhancediterables/EnhancedIterables.java on lines 86..94

                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

                    static <A> EnhancedIterable<A> enhance(Iterable<A> underlying) {
                        requireNonNull(underlying);
                        if (underlying instanceof EnhancedIterable<?>) {
                            return (EnhancedIterable<A>) underlying;
                        } else if (underlying instanceof Collection<?>) {
                src/main/java/software/kes/enhancediterables/EnhancedIterables.java on lines 55..64

                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

                    static <A> ImmutableIterable<A> immutableIterable(Iterable<A> underlying) {
                        requireNonNull(underlying);
                        if (underlying instanceof ImmutableIterable<?>) {
                            return (ImmutableIterable<A>) underlying;
                        } else if (underlying instanceof Collection<?>) {
                src/main/java/software/kes/enhancediterables/EnhancedIterables.java on lines 33..42

                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

                    @Override
                    default Tuple2<? extends ImmutableIterable<A>, ? extends ImmutableIterable<A>> span(Fn1<? super A, ? extends Boolean> predicate) {
                        requireNonNull(predicate);
                        Tuple2<Iterable<A>, Iterable<A>> spanResult = Span.<A>span(predicate).apply(unwrap(this));
                        return tuple(EnhancedIterables.immutableIterable(spanResult._1()),
                src/main/java/software/kes/enhancediterables/FiniteIterable.java on lines 367..373

                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

                    @Override
                    default Tuple2<? extends FiniteIterable<A>, ? extends FiniteIterable<A>> span(Fn1<? super A, ? extends Boolean> predicate) {
                        requireNonNull(predicate);
                        Tuple2<Iterable<A>, Iterable<A>> spanResult = Span.<A>span(predicate).apply(unwrap(this));
                        return tuple(EnhancedIterables.finiteIterable(spanResult._1()),
                src/main/java/software/kes/enhancediterables/ImmutableIterable.java on lines 233..239

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

                package software.kes.enhancediterables;
                
                import com.jnape.palatable.lambda.functions.builtin.fn1.Tail;
                
                class NonEmptyFiniteWrapper<A> extends Wrapped<A> implements NonEmptyFiniteIterable<A> {
                src/main/java/software/kes/enhancediterables/ImmutableNonEmptyFiniteWrapper.java on lines 1..24
                src/main/java/software/kes/enhancediterables/ImmutableNonEmptyWrapper.java on lines 1..25
                src/main/java/software/kes/enhancediterables/NonEmptyWrapper.java on lines 1..24

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

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

                package software.kes.enhancediterables;
                
                import com.jnape.palatable.lambda.functions.builtin.fn1.Tail;
                
                class ImmutableNonEmptyFiniteWrapper<A> extends Wrapped<A> implements ImmutableNonEmptyFiniteIterable<A> {
                src/main/java/software/kes/enhancediterables/ImmutableNonEmptyWrapper.java on lines 1..25
                src/main/java/software/kes/enhancediterables/NonEmptyFiniteWrapper.java on lines 1..24
                src/main/java/software/kes/enhancediterables/NonEmptyWrapper.java on lines 1..24

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

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

                package software.kes.enhancediterables;
                
                import com.jnape.palatable.lambda.functions.builtin.fn1.Tail;
                
                class ImmutableNonEmptyWrapper<A> extends Wrapped<A> implements ImmutableNonEmptyIterable<A> {
                src/main/java/software/kes/enhancediterables/ImmutableNonEmptyFiniteWrapper.java on lines 1..24
                src/main/java/software/kes/enhancediterables/NonEmptyFiniteWrapper.java on lines 1..24
                src/main/java/software/kes/enhancediterables/NonEmptyWrapper.java on lines 1..24

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

                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