ruby-concurrency/thread_safe

View on GitHub

Showing 181 of 329 total issues

File ConcurrentHashMapV8.java has 2355 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/
 */
Severity: Major
Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 6 days to fix

    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 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;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 3 days 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 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;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 2 days 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 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 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;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 2 days 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 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 (Node[] tab = table;;) {
                  int i; Node f; int fh; Object fk, fv;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 2 days 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 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;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 2 days 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 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 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 (Node[] tab = table;;) {
                  Node f; int i, fh; Object fk;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 1 day 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 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 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;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 1 day 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 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
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 1 day 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 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 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 (Node[] tab = table;;) {
                  int i; Node f; int fh; Object fk;
      Severity: Minor
      Found in ext/org/jruby/ext/thread_safe/jsr166e/ConcurrentHashMapV8.java - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Severity
      Category
      Status
      Source
      Language