jdantonio/concurrent-ruby

View on GitHub

Showing 303 of 498 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/
 */

    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;

      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

      File promises.rb has 1196 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'concurrent/synchronization/object'
      require 'concurrent/atomic/atomic_boolean'
      require 'concurrent/atomic/atomic_fixnum'
      require 'concurrent/collection/lock_free_stack'
      require 'concurrent/configuration'
      Severity: Major
      Found in lib/concurrent-ruby/concurrent/promises.rb - About 3 days to fix

        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 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;

        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

        File erlang_actor.rb has 899 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'set'
        require 'concurrent/atomic/count_down_latch'
        require 'concurrent/concern/logging'
        require 'concurrent/edge/channel'
        require 'concurrent/errors'
        Severity: Major
        Found in lib/concurrent-ruby-edge/concurrent/edge/erlang_actor.rb - About 2 days to fix

          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 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;

          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 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;

          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;

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

          Severity
          Category
          Status
          Source
          Language