ruby-concurrency/thread_safe

View on GitHub
ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java

Summary

Maintainability
F
2 mos
Test Coverage

File ConcurrentHashMapV8.java has 2304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Written by Doug Lea with assistance from members of JCP JSR-166
 * Expert Group and released to the public domain, as explained at
 * http://creativecommons.org/publicdomain/zero/1.0/
 */

    Method deleteTreeNode has a Cognitive Complexity of 193 (exceeds 5 allowed). Consider refactoring.
    Open

            final void deleteTreeNode(TreeNode p) {
                TreeNode next = (TreeNode)p.next; // unlink traversal pointers
                TreeNode pred = p.prev;
                if (pred == null)
                    first = next;

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

        private final Object internalComputeIfAbsent(K k,
                                                     Fun<? super K, ?> mf) {
            int h = spread(k.hashCode());
            Object val = null;
            int count = 0;

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

        @SuppressWarnings("unchecked") private final Object internalCompute
        (K k, boolean onlyIfPresent, BiFun<? super K, ? super V, ? extends V> mf) {
            int h = spread(k.hashCode());
            Object val = null;
            int delta = 0;

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

        private final Object internalPutIfAbsent(Object k, Object v) {
            int h = spread(k.hashCode());
            int count = 0;
            for (AtomicReferenceArray<Node> tab = table;;) {
                int i; Node f; int fh; Object fk, fv;

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

            @SuppressWarnings("unchecked") final TreeNode putTreeNode
            (int h, RubyObject k, Object v) {
                RubyClass c = k.getMetaClass();
                boolean kNotComparable = !k.respondsTo("<=>");
                TreeNode pp = root, p = null;

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

        private final Object internalReplace(Object k, Object v, Object cv) {
            int h = spread(k.hashCode());
            Object oldVal = null;
            for (AtomicReferenceArray<Node> tab = table;;) {
                Node f; int i, fh; Object fk;

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

        @SuppressWarnings("unchecked") private final Object internalMerge
        (K k, V v, BiFun<? super V, ? super V, ? extends V> mf) {
            int h = spread(k.hashCode());
            Object val = null;
            int delta = 0;

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

        private final void internalPutAll(Map<?, ?> m) {
            tryPresize(m.size());
            long delta = 0L;     // number of uncommitted additions
            boolean npe = false; // to throw exception on exit for nulls
            try {                // to clean up counts on other exceptions

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

        private final Object internalPut(Object k, Object v) {
            int h = spread(k.hashCode());
            int count = 0;
            for (AtomicReferenceArray<Node> tab = table;;) {
                int i; Node f; int fh; Object fk;

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

        private static final AtomicReferenceArray<Node> rebuild(AtomicReferenceArray<Node> tab) {
            int n = tab.length();
            AtomicReferenceArray<Node> nextTab = new AtomicReferenceArray<Node>(n << 1);
            Node fwd = new Node(MOVED, nextTab, null, null);
            int[] buffer = null;       // holds bins to revisit; null until needed

    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

    ConcurrentHashMapV8 has 58 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ConcurrentHashMapV8<K, V>
            implements ConcurrentMap<K, V>, Serializable, ConcurrentHashMap<K, V> {
        private static final long serialVersionUID = 7249069246763182397L;
    
        /**

      Method readObject has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          @SuppressWarnings("unchecked") private void readObject(java.io.ObjectInputStream s)
                  throws java.io.IOException, ClassNotFoundException {
              s.defaultReadObject();
              this.segments = null; // unneeded
              // initialize transient final field

      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 deleteTreeNode has 159 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              final void deleteTreeNode(TreeNode p) {
                  TreeNode next = (TreeNode)p.next; // unlink traversal pointers
                  TreeNode pred = p.prev;
                  if (pred == null)
                      first = next;

        Method internalClear has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            private final void internalClear() {
                long delta = 0L; // negative number of deletions
                int i = 0;
                AtomicReferenceArray<Node> tab = table;
                while (tab != null && i < tab.length()) {

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

                final V advance() {
                    Node e = next;
                    V ev = null;
                    outer: do {
                        if (e != null)                  // advance past used/skipped node

        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 internalCompute has 126 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @SuppressWarnings("unchecked") private final Object internalCompute
            (K k, boolean onlyIfPresent, BiFun<? super K, ? super V, ? extends V> mf) {
                int h = spread(k.hashCode());
                Object val = null;
                int delta = 0;

          Method internalComputeIfAbsent has 123 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private final Object internalComputeIfAbsent(K k,
                                                           Fun<? super K, ?> mf) {
                  int h = spread(k.hashCode());
                  Object val = null;
                  int count = 0;

            Method getTreeNode has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                    @SuppressWarnings("unchecked") final TreeNode getTreeNode
                    (int h, RubyObject k, TreeNode p) {
                        RubyClass c = k.getMetaClass(); boolean kNotComparable = !k.respondsTo("<=>");
                        while (p != null) {
                            int dir, ph;  RubyObject pk; RubyClass pc;

            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 internalMerge has 103 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @SuppressWarnings("unchecked") private final Object internalMerge
                (K k, V v, BiFun<? super V, ? super V, ? extends V> mf) {
                    int h = spread(k.hashCode());
                    Object val = null;
                    int delta = 0;

              Method internalPutAll has 99 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private final void internalPutAll(Map<?, ?> m) {
                      tryPresize(m.size());
                      long delta = 0L;     // number of uncommitted additions
                      boolean npe = false; // to throw exception on exit for nulls
                      try {                // to clean up counts on other exceptions

                Method internalPutIfAbsent has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private final Object internalPutIfAbsent(Object k, Object v) {
                        int h = spread(k.hashCode());
                        int count = 0;
                        for (AtomicReferenceArray<Node> tab = table;;) {
                            int i; Node f; int fh; Object fk, fv;

                  Method rebuild has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static final AtomicReferenceArray<Node> rebuild(AtomicReferenceArray<Node> tab) {
                          int n = tab.length();
                          AtomicReferenceArray<Node> nextTab = new AtomicReferenceArray<Node>(n << 1);
                          Node fwd = new Node(MOVED, nextTab, null, null);
                          int[] buffer = null;       // holds bins to revisit; null until needed

                    Method putTreeNode has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            @SuppressWarnings("unchecked") final TreeNode putTreeNode
                            (int h, RubyObject k, Object v) {
                                RubyClass c = k.getMetaClass();
                                boolean kNotComparable = !k.respondsTo("<=>");
                                TreeNode pp = root, p = null;

                      Method internalReplace has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private final Object internalReplace(Object k, Object v, Object cv) {
                              int h = spread(k.hashCode());
                              Object oldVal = null;
                              for (AtomicReferenceArray<Node> tab = table;;) {
                                  Node f; int i, fh; Object fk;

                        Method tryAwaitLock has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                                final void tryAwaitLock(AtomicReferenceArray<Node> tab, int i) {
                                    if (tab != null && i >= 0 && i < tab.length()) { // sanity check
                                        int r = ThreadLocalRandom.current().nextInt(); // randomize spins
                                        int spins = MAX_SPINS, h;
                                        while (tabAt(tab, i) == this && ((h = hash) & LOCKED) != 0) {

                        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 internalPut has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private final Object internalPut(Object k, Object v) {
                                int h = spread(k.hashCode());
                                int count = 0;
                                for (AtomicReferenceArray<Node> tab = table;;) {
                                    int i; Node f; int fh; Object fk;

                          Method tryPresize has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private final void tryPresize(int size) {
                                  int c = (size >= (MAXIMUM_CAPACITY >>> 1)) ? MAXIMUM_CAPACITY :
                                          tableSizeFor(size + (size >>> 1) + 1);
                                  int sc;
                                  while ((sc = sizeCtl) >= 0) {

                          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 readObject has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @SuppressWarnings("unchecked") private void readObject(java.io.ObjectInputStream s)
                                      throws java.io.IOException, ClassNotFoundException {
                                  s.defaultReadObject();
                                  this.segments = null; // unneeded
                                  // initialize transient final field

                            Method equals has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public boolean equals(Object o) {
                                    if (o != this) {
                                        if (!(o instanceof Map))
                                            return false;
                                        Map<?,?> m = (Map<?,?>) o;

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

                                private final Object internalGet(Object k) {
                                    int h = spread(k.hashCode());
                                    retry: for (AtomicReferenceArray<Node> tab = table; tab != null;) {
                                        Node e, p; Object ek, ev; int eh;      // locals to read fields once
                                        for (e = tabAt(tab, (tab.length() - 1) & h); e != null; e = e.next) {

                            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 internalClear has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private final void internalClear() {
                                    long delta = 0L; // negative number of deletions
                                    int i = 0;
                                    AtomicReferenceArray<Node> tab = table;
                                    while (tab != null && i < tab.length()) {

                              Method toArray has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      @SuppressWarnings("unchecked") public final <T> T[] toArray(T[] a) {
                                          long sz = map.mappingCount();
                                          if (sz > (long)(MAX_ARRAY_SIZE))
                                              throw new OutOfMemoryError(oomeMsg);
                                          int m = (int)sz;

                              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 splitTreeBin has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private static void splitTreeBin(AtomicReferenceArray<Node> nextTab, int i, TreeBin t) {
                                      int bit = nextTab.length() >>> 1;
                                      TreeBin lt = new TreeBin();
                                      TreeBin ht = new TreeBin();
                                      int lc = 0, hc = 0;

                                Method toArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                        public final Object[] toArray() {
                                            long sz = map.mappingCount();
                                            if (sz > (long)(MAX_ARRAY_SIZE))
                                                throw new OutOfMemoryError(oomeMsg);
                                            int n = (int)sz;

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

                                    private final AtomicReferenceArray<Node> initTable() {
                                        AtomicReferenceArray<Node> tab; int sc;
                                        while ((tab = table) == null) {
                                            if ((sc = sizeCtl) < 0)
                                                Thread.yield(); // lost initialization race; just spin

                                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 tryPresize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private final void tryPresize(int size) {
                                        int c = (size >= (MAXIMUM_CAPACITY >>> 1)) ? MAXIMUM_CAPACITY :
                                                tableSizeFor(size + (size >>> 1) + 1);
                                        int sc;
                                        while ((sc = sizeCtl) >= 0) {

                                  Method advance has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          final V advance() {
                                              Node e = next;
                                              V ev = null;
                                              outer: do {
                                                  if (e != null)                  // advance past used/skipped node

                                    Method splitTreeBin has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private static void splitTreeBin(AtomicReferenceArray<Node> nextTab, int i, TreeBin t) {
                                            int bit = nextTab.length() >>> 1;
                                            TreeBin lt = new TreeBin();
                                            TreeBin ht = new TreeBin();
                                            int lc = 0, hc = 0;

                                    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 toArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            @SuppressWarnings("unchecked") public final <T> T[] toArray(T[] a) {
                                                long sz = map.mappingCount();
                                                if (sz > (long)(MAX_ARRAY_SIZE))
                                                    throw new OutOfMemoryError(oomeMsg);
                                                int m = (int)sz;

                                      Method tryAwaitLock has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              final void tryAwaitLock(AtomicReferenceArray<Node> tab, int i) {
                                                  if (tab != null && i >= 0 && i < tab.length()) { // sanity check
                                                      int r = ThreadLocalRandom.current().nextInt(); // randomize spins
                                                      int spins = MAX_SPINS, h;
                                                      while (tabAt(tab, i) == this && ((h = hash) & LOCKED) != 0) {

                                        Method getTreeNode has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                @SuppressWarnings("unchecked") final TreeNode getTreeNode
                                                (int h, RubyObject k, TreeNode p) {
                                                    RubyClass c = k.getMetaClass(); boolean kNotComparable = !k.respondsTo("<=>");
                                                    while (p != null) {
                                                        int dir, ph;  RubyObject pk; RubyClass pc;

                                          Method writeObject has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              @SuppressWarnings("unchecked") private void writeObject(java.io.ObjectOutputStream s)
                                                      throws java.io.IOException {
                                                  if (segments == null) { // for serialization compatibility
                                                      segments = (Segment<K,V>[])
                                                              new Segment<?,?>[DEFAULT_CONCURRENCY_LEVEL];
                                          Severity: Minor
                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 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

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                              if (count >= TREE_THRESHOLD)
                                                                                  replaceWithTreeBin(tab, i, k);
                                          Severity: Major
                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                                if ((e.val = v) == null) {
                                                                                    deleted = true;
                                                                                    Node en = e.next;
                                                                                    if (pred != null)
                                                                                        pred.next = en;
                                            Severity: Major
                                            Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                                      if (count >= TREE_THRESHOLD)
                                                                                          replaceWithTreeBin(tab, i, k);
                                              Severity: Major
                                              Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                            if ((pr = p.right) != null && h >= pr.hash && (r = getTreeNode(h, k, pr)) != null)
                                                                                return r;
                                                                            // try to continue iterating on the left side
                                                                            else if ((pl = p.left) != null && h <= pl.hash)
                                                                                dir = -1;
                                                Severity: Major
                                                Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                          for (Node e = tabAt(tab, i); e != null; e = e.next) {
                                                                              if (++c > TREE_THRESHOLD &&
                                                                                      (e.key instanceof Comparable)) {
                                                                                  replaceWithTreeBin(tab, i, e.key);
                                                                                  break;
                                                  Severity: Major
                                                  Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                if ((pr = p.right) != null && h >= pr.hash && (r = getTreeNode(h, k, pr)) != null)
                                                                                    return r;
                                                                                else // continue descending down the left subtree
                                                                                    dir = -1;
                                                    Severity: Major
                                                    Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                          if ((p.val = v) == null) {
                                                                                              deleted = true;
                                                                                              t.deleteTreeNode(p);
                                                                                          }
                                                      Severity: Major
                                                      Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                    if (!collide && q != null && q.hash == p.hash)
                                                                                        collide = true;
                                                        Severity: Major
                                                        Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 45 mins to fix

                                                          Method remove has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                                  public final boolean remove(Object o) {
                                                                      if (o != null) {
                                                                          Iterator<V> it = new ValueIterator<K,V>(map);
                                                                          while (it.hasNext()) {
                                                                              if (o.equals(it.next())) {
                                                          Severity: Minor
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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 splitBin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              private static void splitBin(AtomicReferenceArray<Node> nextTab, int i, Node e) {
                                                                  int bit = nextTab.length() >>> 1; // bit to split on
                                                                  int runBit = e.hash & bit;
                                                                  Node lastRun = e, lo = null, hi = null;
                                                                  for (Node p = e.next; p != null; p = p.next) {
                                                          Severity: Minor
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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 containsAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                                  public final boolean containsAll(Collection<?> c) {
                                                                      if (c != this) {
                                                                          for (Iterator<?> it = c.iterator(); it.hasNext();) {
                                                                              Object e = it.next();
                                                                              if (e == null || !contains(e))
                                                          Severity: Minor
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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 getValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                                  final Object getValue(int h, Object k) {
                                                                      Node r = null;
                                                                      int c = getState(); // Must read lock state first
                                                                      for (Node e = first; e != null; e = e.next) {
                                                                          if (c <= 0 && compareAndSetState(c, c - 1)) {
                                                          Severity: Minor
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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 toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                                  public final String toString() {
                                                                      StringBuilder sb = new StringBuilder();
                                                                      sb.append('[');
                                                                      Iterator<?> it = iterator();
                                                                      if (it.hasNext()) {
                                                          Severity: Minor
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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 toString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              public String toString() {
                                                                  Traverser<K,V,Object> it = new Traverser<K,V,Object>(this);
                                                                  StringBuilder sb = new StringBuilder();
                                                                  sb.append('{');
                                                                  Object v;
                                                          Severity: Minor
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                  return val;
                                                          Severity: Major
                                                          Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                    return null;
                                                            Severity: Major
                                                            Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java - About 30 mins to fix

                                                              Method rotateRight has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                      private void rotateRight(TreeNode p) {
                                                                          if (p != null) {
                                                                              TreeNode l = p.left, pp, lr;
                                                                              if ((lr = p.left = l.right) != null)
                                                                                  lr.parent = p;
                                                              Severity: Minor
                                                              Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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

                                                              Method rotateLeft has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                      private void rotateLeft(TreeNode p) {
                                                                          if (p != null) {
                                                                              TreeNode r = p.right, pp, rl;
                                                                              if ((rl = p.right = r.left) != null)
                                                                                  rl.parent = p;
                                                              Severity: Minor
                                                              Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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

                                                              Method addAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                      public boolean addAll(Collection<? extends K> c) {
                                                                          boolean added = false;
                                                                          V v;
                                                                          if ((v = value) == null)
                                                                              throw new UnsupportedOperationException();
                                                              Severity: Minor
                                                              Found in ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.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

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

                                                                  static final class TreeBin extends AbstractQueuedSynchronizer {
                                                                      private static final long serialVersionUID = 2249069246763182397L;
                                                                      transient TreeNode root;  // root of tree
                                                                      transient TreeNode first; // head of next-pointer list
                                                              
                                                              
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 769..1197

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

                                                              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

                                                                  static abstract class CHMView<K, V> {
                                                                      final ConcurrentHashMapV8<K, V> map;
                                                                      CHMView(ConcurrentHashMapV8<K, V> map)  { this.map = map; }
                                                              
                                                                      /**
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3497..3628

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

                                                              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

                                                                      for (int i = bin;;) {      // start upwards sweep
                                                                          int fh; Node f;
                                                                          if ((f = tabAt(tab, i)) == null) {
                                                                              if (bin >= 0) {    // Unbuffered; no lock needed (or available)
                                                                                  if (!casTabAt(tab, i, f, fwd))
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2159..2245

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

                                                              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

                                                                          else if ((fh = f.hash) == MOVED) {
                                                                              if ((fk = f.key) instanceof TreeBin) {
                                                                                  TreeBin t = (TreeBin)fk;
                                                                                  boolean validated = false;
                                                                                  boolean deleted = false;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1272..1351

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

                                                              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

                                                                                  else if ((fh = f.hash) == MOVED) {
                                                                                      if ((fk = f.key) instanceof TreeBin) {
                                                                                          TreeBin t = (TreeBin)fk;
                                                                                          boolean validated = false;
                                                                                          t.acquire(0);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1962..2030

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

                                                              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

                                                                      while (tab != null && i < tab.length()) {
                                                                          int fh; Object fk;
                                                                          Node f = tabAt(tab, i);
                                                                          if (f == null)
                                                                              ++i;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2326..2378

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

                                                              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

                                                                  public static final class EntrySetView<K,V> extends CHMView<K,V>
                                                                          implements Set<Map.Entry<K,V>> {
                                                                      EntrySetView(ConcurrentHashMapV8<K, V> map) { super(map); }
                                                                      public final boolean contains(Object o) {
                                                                          Object k, v, r; Map.Entry<?,?> e;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3753..3807

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

                                                              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

                                                                              try {
                                                                                  if (tabAt(tab, i) == f) {
                                                                                      count = 1;
                                                                                      for (Node e = f, pred = null;; ++count) {
                                                                                          Object ek, ev;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1776..1814

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

                                                              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

                                                                              try {
                                                                                  if (tabAt(tab, i) == f) {
                                                                                      count = 1;
                                                                                      for (Node e = f, pred = null;; ++count) {
                                                                                          Object ek, ev;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1885..1922

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

                                                              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

                                                                  public static class KeySetView<K,V> extends CHMView<K,V> implements Set<K>, java.io.Serializable {
                                                                      private static final long serialVersionUID = 7249069246763182397L;
                                                                      private final V value;
                                                                      KeySetView(ConcurrentHashMapV8<K, V> map, V value) {  // non-public
                                                                          super(map);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3637..3697

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

                                                              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

                                                                                  try {
                                                                                      if (tabAt(tab, i) == f) {
                                                                                          count = 1;
                                                                                          for (Node e = f;; ++count) {
                                                                                              Object ek, ev;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1652..1680

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

                                                              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

                                                                          else if ((fh = f.hash) == MOVED) {
                                                                              if ((fk = f.key) instanceof TreeBin) {
                                                                                  TreeBin t = (TreeBin)fk;
                                                                                  t.acquire(0);
                                                                                  try {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1733..1770

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

                                                              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

                                                                  static final class MapEntry<K,V> implements Map.Entry<K, V> {
                                                                      final K key; // non-null
                                                                      V val;       // non-null
                                                                      final ConcurrentHashMapV8<K, V> map;
                                                                      MapEntry(K key, V val, ConcurrentHashMapV8<K, V> map) {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3293..3331

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

                                                              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

                                                                              try {                        // needed in case equals() throws
                                                                                  if (tabAt(tab, i) == f) {
                                                                                      count = 1;
                                                                                      for (Node e = f;; ++count) {
                                                                                          Object ek, ev;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1428..1454

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

                                                              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

                                                                          else if ((fh = f.hash) == MOVED) {
                                                                              if ((fk = f.key) instanceof TreeBin) {
                                                                                  TreeBin t = (TreeBin)fk;
                                                                                  t.acquire(0);
                                                                                  try {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1848..1879

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

                                                              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

                                                                                  try {
                                                                                      if (tabAt(tab, i) == f) {
                                                                                          count = 1;
                                                                                          for (Node e = f;; ++count) {
                                                                                              Object ek, ev;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1529..1554

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

                                                              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

                                                                  public boolean equals(Object o) {
                                                                      if (o != this) {
                                                                          if (!(o instanceof Map))
                                                                              return false;
                                                                          Map<?,?> m = (Map<?,?>) o;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3197..3219

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

                                                              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

                                                                          if (tab != null && i >= 0 && i < tab.length()) { // sanity check
                                                                              int r = ThreadLocalRandom.current().nextInt(); // randomize spins
                                                                              int spins = MAX_SPINS, h;
                                                                              while (tabAt(tab, i) == this && ((h = hash) & LOCKED) != 0) {
                                                                                  if (spins >= 0) {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 664..689

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

                                                              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

                                                                          else if ((fh = f.hash) == MOVED) {
                                                                              if ((fk = f.key) instanceof TreeBin) {
                                                                                  TreeBin t = (TreeBin)fk;
                                                                                  boolean added = false;
                                                                                  t.acquire(0);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1600..1628

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

                                                              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

                                                                          else if ((f = tabAt(tab, i = (tab.length() - 1) & h)) == null) {
                                                                              if (onlyIfPresent)
                                                                                  break;
                                                                              Node node = new Node(fh = h | LOCKED, k, null, null);
                                                                              if (casTabAt(tab, i, null, node)) {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1710..1732

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

                                                              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

                                                                          else if ((fh = f.hash) == MOVED) {
                                                                              if ((fk = f.key) instanceof TreeBin) {
                                                                                  TreeBin t = (TreeBin)fk;
                                                                                  Object oldVal = null;
                                                                                  t.acquire(0);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1396..1421

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

                                                              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

                                                                  public String toString() {
                                                                      Traverser<K,V,Object> it = new Traverser<K,V,Object>(this);
                                                                      StringBuilder sb = new StringBuilder();
                                                                      sb.append('{');
                                                                      Object v;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3168..3185

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

                                                              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

                                                                          else if ((f = tabAt(tab, i = (tab.length() - 1) & h)) == null) {
                                                                              Node node = new Node(fh = h | LOCKED, k, null, null);
                                                                              if (casTabAt(tab, i, null, node)) {
                                                                                  count = 1;
                                                                                  try {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1581..1599

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

                                                              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

                                                                          else if ((fh = f.hash) == MOVED) {
                                                                              if ((fk = f.key) instanceof TreeBin) {
                                                                                  TreeBin t = (TreeBin)fk;
                                                                                  Object oldVal = null;
                                                                                  t.acquire(0);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1482..1505

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

                                                              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

                                                                  @SuppressWarnings("unchecked") private void writeObject(java.io.ObjectOutputStream s)
                                                                          throws java.io.IOException {
                                                                      if (segments == null) { // for serialization compatibility
                                                                          segments = (Segment<K,V>[])
                                                                                  new Segment<?,?>[DEFAULT_CONCURRENCY_LEVEL];
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3354..3372

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

                                                              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

                                                                  public ConcurrentHashMapV8(int initialCapacity,
                                                                                             float loadFactor, int concurrencyLevel) {
                                                                      if (!(loadFactor > 0.0f) || initialCapacity < 0 || concurrencyLevel <= 0)
                                                                          throw new IllegalArgumentException();
                                                                      if (initialCapacity < concurrencyLevel)   // Use at least as many bins
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2592..2603

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

                                                              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

                                                                          for (e = tabAt(tab, (tab.length() - 1) & h); e != null; e = e.next) {
                                                                              if ((eh = e.hash) == MOVED) {
                                                                                  if ((ek = e.key) instanceof TreeBin)  // search TreeBin
                                                                                      return ((TreeBin)ek).getValue(h, k);
                                                                                  else {                        // restart with new table
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1241..1253

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

                                                              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

                                                                  @SuppressWarnings("serial") static final class EntryIterator<K,V> extends Traverser<K,V,Object>
                                                                          implements Spliterator<Map.Entry<K,V>> {
                                                                      EntryIterator(ConcurrentHashMapV8<K, V> map) { super(map); }
                                                                      EntryIterator(Traverser<K,V,Object> it) {
                                                                          super(it);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3268..3288

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

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

                                                                              if (g != null) { // at least 2 nodes -- search and maybe resize
                                                                                  for (Node e = g;;) {
                                                                                      Object ek, ev;
                                                                                      if ((e.hash & HASH_BITS) == h && (ev = e.val) != null &&
                                                                                              ((ek = e.key) == k || k.equals(ek)))
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1511..1522
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1634..1645
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 1626..1637

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

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

                                                                              if (g != null) {
                                                                                  for (Node e = g;;) {
                                                                                      Object ek, ev;
                                                                                      if ((e.hash & HASH_BITS) == h && (ev = e.val) != null &&
                                                                                              ((ek = e.key) == k || k.equals(ek)))
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1511..1522
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1634..1645
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 1503..1514

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

                                                              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

                                                                  @SuppressWarnings("serial") static final class ValueIterator<K,V> extends Traverser<K,V,Object>
                                                                          implements Spliterator<V>, Enumeration<V> {
                                                                      ValueIterator(ConcurrentHashMapV8<K, V> map) { super(map); }
                                                                      ValueIterator(Traverser<K,V,Object> it) {
                                                                          super(it);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3245..3266

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

                                                              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

                                                                      for (Node e = t.first; e != null; e = e.next) {
                                                                          int h = e.hash & HASH_BITS;
                                                                          Object k = e.key, v = e.val;
                                                                          if ((h & bit) == 0) {
                                                                              ++lc;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2287..2298

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

                                                              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

                                                                  private static final int tableSizeFor(int c) {
                                                                      int n = c - 1;
                                                                      n |= n >>> 1;
                                                                      n |= n >>> 2;
                                                                      n |= n >>> 4;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2047..2055

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

                                                              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

                                                                  public static final class ValuesView<K,V> extends CHMView<K,V>
                                                                          implements Collection<V> {
                                                                      ValuesView(ConcurrentHashMapV8<K, V> map)   { super(map); }
                                                                      public final boolean contains(Object o) { return map.containsValue(o); }
                                                                      public final boolean remove(Object o) {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3710..3746

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

                                                              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

                                                                                      while (p != null) {
                                                                                          int j = p.hash & mask;
                                                                                          Node next = p.next;
                                                                                          Node q = p.next = tabAt(tab, j);
                                                                                          setTabAt(tab, j, p);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3417..3425

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

                                                              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

                                                                  @SuppressWarnings("serial") static final class KeyIterator<K,V> extends Traverser<K,V,Object>
                                                                          implements Spliterator<K>, Enumeration<K> {
                                                                      KeyIterator(ConcurrentHashMapV8<K, V> map) { super(map); }
                                                                      KeyIterator(Traverser<K,V,Object> it) {
                                                                          super(it);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3223..3243

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

                                                              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

                                                                      for (Node p = e; p != lastRun; p = p.next) {
                                                                          int ph = p.hash & HASH_BITS;
                                                                          Object pk = p.key, pv = p.val;
                                                                          if ((ph & bit) == 0)
                                                                              lo = new Node(ph, pk, pv, lo);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2267..2274

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

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

                                                                      if (lc <= (TREE_THRESHOLD >>> 1)) {
                                                                          ln = null;
                                                                          for (Node p = lt.first; p != null; p = p.next)
                                                                              ln = new Node(p.hash, p.key, p.val, ln);
                                                                      }
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2300..2306
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2308..2314
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 2300..2306

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

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

                                                                      if (hc <= (TREE_THRESHOLD >>> 1)) {
                                                                          hn = null;
                                                                          for (Node p = ht.first; p != null; p = p.next)
                                                                              hn = new Node(p.hash, p.key, p.val, hn);
                                                                      }
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2300..2306
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2308..2314
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 2292..2298

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

                                                              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

                                                                      for (;;) {
                                                                          K k = (K) s.readObject();
                                                                          V v = (V) s.readObject();
                                                                          if (k != null && v != null) {
                                                                              int h = spread(k.hashCode());
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3388..3398

                                                              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

                                                                  public ConcurrentHashMapV8(int initialCapacity) {
                                                                      if (initialCapacity < 0)
                                                                          throw new IllegalArgumentException();
                                                                      int cap = ((initialCapacity >= (MAXIMUM_CAPACITY >>> 1)) ?
                                                                              MAXIMUM_CAPACITY :
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2534..2542

                                                              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

                                                                  public K findKey(Object value) {
                                                                      if (value == null)
                                                                          throw new NullPointerException();
                                                                      Object v;
                                                                      Traverser<K,V,Object> it = new Traverser<K,V,Object>(this);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2733..2743

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

                                                              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

                                                                              (tab.length() >= MAXIMUM_CAPACITY || counter.sum() < (long)sizeCtl)) {
                                                                          TreeBin t = new TreeBin();
                                                                          for (Node e = tabAt(tab, index); e != null; e = e.next)
                                                                              t.putTreeNode(e.hash & HASH_BITS, e.key, e.val);
                                                                          setTabAt(tab, index, new Node(MOVED, t, null, null));
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1226..1231

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

                                                              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

                                                                                  for (int i = 0; i < tab.length(); ++i) {
                                                                                      int c = 0;
                                                                                      for (Node e = tabAt(tab, i); e != null; e = e.next) {
                                                                                          if (++c > TREE_THRESHOLD &&
                                                                                                  (e.key instanceof Comparable)) {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3435..3444

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

                                                              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

                                                                  public boolean containsValue(Object value) {
                                                                      if (value == null)
                                                                          throw new NullPointerException();
                                                                      Object v;
                                                                      Traverser<K,V,Object> it = new Traverser<K,V,Object>(this);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2721..2731

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

                                                              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

                                                                                  if ((e = tabAt(t, i)) != null && e.hash == MOVED) {
                                                                                      if ((ek = e.key) instanceof TreeBin)
                                                                                          e = ((TreeBin)ek).first;
                                                                                      else {
                                                                                          tab = (AtomicReferenceArray<Node>)ek;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2482..2489

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

                                                              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

                                                                  public int hashCode() {
                                                                      int h = 0;
                                                                      Traverser<K,V,Object> it = new Traverser<K,V,Object>(this);
                                                                      Object v;
                                                                      while ((v = it.advance()) != null) {
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3147..3155

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

                                                              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

                                                                      for (Node p = e.next; p != null; p = p.next) {
                                                                          int b = p.hash & bit;
                                                                          if (b != runBit) {
                                                                              runBit = b;
                                                                              lastRun = p;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2256..2262

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

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

                                                                              SIZE_CTRL_UPDATER.compareAndSet(this, sc, -1)) {
                                                                          try {
                                                                              if (tab == table) {
                                                                                  table = rebuild(tab);
                                                                                  sc = (n << 1) - (n >>> 1);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2092..2101
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2130..2139
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 2122..2131

                                                              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

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

                                                                          else if (SIZE_CTRL_UPDATER.compareAndSet(this, sc, -1)) {
                                                                              try {
                                                                                  if (table == tab) {
                                                                                      table = rebuild(tab);
                                                                                      sc = (n << 1) - (n >>> 1);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2092..2101
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2130..2139
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 2084..2093

                                                              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

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

                                                                          if (size >= (long)(MAXIMUM_CAPACITY >>> 1))
                                                                              n = MAXIMUM_CAPACITY;
                                                                          else {
                                                                              int sz = (int)size;
                                                                              n = tableSizeFor(sz + (sz >>> 1) + 1);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3402..3407

                                                              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

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

                                                                      public final void remove() {
                                                                          Object k = nextKey;
                                                                          if (k == null && (advance() == null || (k = nextKey) == null))
                                                                              throw new IllegalStateException();
                                                                          map.internalReplace(k, null, null);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2498..2503

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

                                                              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

                                                                  static final class TreeNode extends Node {
                                                                      TreeNode parent;  // red-black tree links
                                                                      TreeNode left;
                                                                      TreeNode right;
                                                                      TreeNode prev;    // needed to unlink next upon deletion
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 713..724

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

                                                              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

                                                                              if (entry == null || (k = entry.getKey()) == null ||
                                                                                      (v = entry.getValue()) == null) {
                                                                                  npe = true;
                                                                                  break;
                                                                              }
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1946..1950

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

                                                              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

                                                                  public int size() {
                                                                      long n = counter.sum();
                                                                      return ((n < 0L) ? 0 :
                                                                              (n > (long)Integer.MAX_VALUE) ? Integer.MAX_VALUE :
                                                                                      (int)n);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2641..2646

                                                              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

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

                                                                      Node(int hash, Object key, Object val, Node next) {
                                                                          this.hash = hash;
                                                                          this.key = key;
                                                                          this.val = val;
                                                                          this.next = next;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 630..635

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

                                                              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

                                                                  public boolean replace(K key, V oldValue, V newValue) {
                                                                      if (key == null || oldValue == null || newValue == null)
                                                                          throw new NullPointerException();
                                                                      return internalReplace(key, newValue, oldValue) != null;
                                                                  }
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3006..3010

                                                              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

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

                                                                  private static final int spread(int h) {
                                                                      h ^= (h >>> 18) ^ (h >>> 12);
                                                                      return (h ^ (h >>> 10)) & HASH_BITS;
                                                                  }
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1214..1217

                                                              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

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

                                                                          it.baseLimit = this.index = this.baseIndex =
                                                                                  ((this.baseLimit = it.baseLimit) + it.baseIndex + 1) >>> 1;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2456..2457

                                                              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

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

                                                                  @SuppressWarnings("unchecked") public V merge
                                                                  (K key, V value, BiFun<? super V, ? super V, ? extends V> remappingFunction) {
                                                                      if (key == null || value == null || remappingFunction == null)
                                                                          throw new NullPointerException();
                                                                      return (V)internalMerge(key, value, remappingFunction);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2966..2971

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

                                                              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

                                                                  public boolean remove(Object key, Object value) {
                                                                      if (key == null)
                                                                          throw new NullPointerException();
                                                                      if (value == null)
                                                                          return false;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2993..2999

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

                                                              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

                                                                  @SuppressWarnings("unchecked") public V getValueOrDefault(Object key, V defaultValue) {
                                                                      if (key == null)
                                                                          throw new NullPointerException();
                                                                      V v = (V) internalGet(key);
                                                                      return v == null ? defaultValue : v;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2689..2694

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

                                                              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

                                                                          else if ((f = tabAt(tab, i = (tab.length() - 1) & h)) == null) {
                                                                              if (casTabAt(tab, i, null, new Node(h, k, v, null))) {
                                                                                  delta = 1;
                                                                                  val = v;
                                                                                  break;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 1841..1847

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

                                                              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

                                                                      int c = (size >= (MAXIMUM_CAPACITY >>> 1)) ? MAXIMUM_CAPACITY :
                                                                              tableSizeFor(size + (size >>> 1) + 1);
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 2110..2111

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

                                                              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

                                                                                  if (count != 0) {
                                                                                      if (oldVal != null)
                                                                                          return oldVal;
                                                                                      if (tab.length() <= 64)
                                                                                          count = 2;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 1447..1453

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

                                                              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

                                                                              if (count != 0) {
                                                                                  if (oldVal != null)
                                                                                      return oldVal;
                                                                                  if (tab.length() <= 64)
                                                                                      count = 2;
                                                              ext/org/jruby/ext/thread_safe/jsr166e/nounsafe/ConcurrentHashMapV8.java on lines 1547..1553

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

                                                              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

                                                                          if (!init) { // Can only happen if unsafely published.
                                                                              while (p != null) {
                                                                                  internalPut(p.key, p.val);
                                                                                  p = p.next;
                                                                              }
                                                              ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java on lines 3447..3452

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

                                                              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

                                                              There are no issues that match your filters.

                                                              Category
                                                              Status