ruboto/ruboto

View on GitHub

Showing 250 of 293 total issues

File OpenFile.java has 2078 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package org.jruby.util.io;

import jnr.constants.platform.Errno;
import jnr.constants.platform.OpenFlags;
import org.jcodings.Encoding;
Severity: Major
Found in lib/overrides_below_24/OpenFile.java - About 5 days to fix

    Method glob_helper has a Cognitive Complexity of 177 (exceeds 5 allowed). Consider refactoring.
    Open

        private static int glob_helper(Ruby runtime, String cwd,
            byte[] path, int begin, int end, Encoding enc, int sub,
            int flags, GlobFunc<GlobArgs> func, GlobArgs arg) {
            int status = 0;
    
    
    Severity: Minor
    Found in assets/app/src/main/java/org/jruby/util/Dir.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

    OpenFile has 161 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class OpenFile implements Finalizable {
    
        // RB_IO_FPTR_NEW, minus fields that Java already initializes the same way
        public OpenFile(IRubyObject nil) {
            runtime = nil.getRuntime();
    Severity: Major
    Found in lib/overrides_below_24/OpenFile.java - About 3 days to fix

      Method finishWriteconv has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
      Open

          IRubyObject finishWriteconv(ThreadContext context, boolean noalloc) {
              byte[] dsBytes;
              int ds, de;
              Ptr dpPtr = new Ptr();
              EConvResult res;
      Severity: Minor
      Found in lib/overrides_below_24/OpenFile.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

      File Dir.java has 745 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /***** BEGIN LICENSE BLOCK *****
       * Version: EPL 2.0/GPL 2.0/LGPL 2.1
       *
       * The contents of this file are subject to the Eclipse Public
       * License Version 2.0 (the "License"); you may not use this file
      Severity: Major
      Found in assets/app/src/main/java/org/jruby/util/Dir.java - About 1 day to fix

        Method main has 336 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def self.main
                Main do
                  mode 'init' do
                    require 'ruboto/util/update'
                    include Ruboto::Util::LogAction
        Severity: Major
        Found in lib/ruboto/commands/base.rb - About 1 day to fix

          File setup.rb has 675 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'ruboto/sdk_versions'
          require 'ruboto/util/verify'
          
          module Ruboto
            module Util
          Severity: Major
          Found in lib/ruboto/util/setup.rb - About 1 day to fix

            Method reconfigure_jruby_core has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
            Open

                  def reconfigure_jruby_core(jruby_core_version)
                    Dir.chdir 'libs' do
                      jruby_core = Dir['jruby-core-*.jar'][-1]
                      log_action("Removing unneeded classes from #{jruby_core}") do
                        FileUtils.rm_rf 'tmp'
            Severity: Minor
            Found in lib/ruboto/util/update.rb - 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

            File update.rb has 628 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'ruboto/version'
            require 'ruboto/core_ext/rexml'
            require 'ruboto/sdk_locations'
            require 'ruboto/util/build'
            
            
            Severity: Major
            Found in lib/ruboto/util/update.rb - About 1 day to fix

              Method helper has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
              Open

                      int helper(byte[] pbytes, int pend, byte[] sbytes, int send, Encoding enc) {
                          int s = scur;
                          int p = pcur;
              
                          int ptmp = -1;
              Severity: Minor
              Found in assets/app/src/main/java/org/jruby/util/Dir.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 bracket has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
              Open

                      public int bracket(byte[] pbytes, int p, int pend, byte[] sbytes, int s, int send, Encoding enc) {
                          boolean not = false;
                          boolean ok = false;
                          int r;
                          int c1, c2;
              Severity: Minor
              Found in assets/app/src/main/java/org/jruby/util/Dir.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 getc has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
              Open

                  public IRubyObject getc(ThreadContext context, Encoding enc) {
                      Ruby runtime = context.runtime;
                      int r, n, cr = 0;
                      IRubyObject str;
              
              
              Severity: Minor
              Found in lib/overrides_below_24/OpenFile.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 reconfigure_jruby_core has 243 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def reconfigure_jruby_core(jruby_core_version)
                      Dir.chdir 'libs' do
                        jruby_core = Dir['jruby-core-*.jar'][-1]
                        log_action("Removing unneeded classes from #{jruby_core}") do
                          FileUtils.rm_rf 'tmp'
              Severity: Major
              Found in lib/ruboto/util/update.rb - About 1 day to fix

                Method generateDex has 231 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static <T extends DynamicScope> Class<?> generateDex(final int size, final String clsPath, final String clsName) throws IOException, ClassNotFoundException {
                        // ensure only one thread will attempt to generate and define the new class
                        synchronized (CDCL) {
                            // create a new one
                            final String[] newFields = varList(size);
                Severity: Major
                Found in lib/DynamicScopeGenerator.java - About 1 day to fix

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

                      public boolean swallow(ThreadContext context, int term) {
                          Ruby runtime = context.runtime;
                  
                          boolean locked = lock();
                          try {
                  Severity: Minor
                  Found in lib/overrides_below_24/OpenFile.java - About 7 hrs 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 appendline has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public int appendline(ThreadContext context, int delim, ByteList[] strp, int[] lp) {
                          ByteList str = strp[0];
                          int limit = lp[0];
                  
                          if (needsReadConversion()) {
                  Severity: Minor
                  Found in lib/overrides_below_24/OpenFile.java - About 7 hrs 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 braces has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static ArrayList<String> braces(String pattern, int flags, ArrayList<String> patterns) {
                          boolean escape = (flags & FNM_NOESCAPE) == 0;
                  
                          int rbrace = -1;
                          int lbrace = -1;
                  Severity: Minor
                  Found in assets/app/src/main/java/org/jruby/util/Dir.java - About 7 hrs 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 ioBufread has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private int ioBufread(ThreadContext context, byte[] ptrBytes, int ptr, int len) {
                          int offset = 0;
                          int n = len;
                          int c;
                  
                  
                  Severity: Minor
                  Found in lib/overrides_below_24/OpenFile.java - About 7 hrs 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 binwrite has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public long binwrite(ThreadContext context, IRubyObject str, byte[] ptrBytes, int ptr, int len, boolean nosync) {
                          int n, r, offset = 0;
                  
                          /* don't write anything if current thread has a pending interrupt. */
                          context.pollThreadEvents();
                  Severity: Minor
                  Found in lib/overrides_below_24/OpenFile.java - About 7 hrs 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 loadScript has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static void loadScript(final RubotoComponent component) {
                          try {
                              if (component.getScriptInfo().getScriptName() != null) {
                                  Log.d("Looking for Ruby class: " + component.getScriptInfo().getRubyClassName());
                                  Object rubyClass = JRubyAdapter.get(component.getScriptInfo().getRubyClassName());
                  Severity: Minor
                  Found in assets/app/src/main/java/org/ruboto/ScriptLoader.java - About 6 hrs 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