Code Monkey home page Code Monkey logo

rubysonar's Issues

build error

localhost:rubysonar apple$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building rubysonar 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ rubysonar ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ rubysonar ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 73 source files to /Users/apple/projects/rubysonar/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.971s
[INFO] Finished at: Wed Feb 19 02:19:51 CST 2014
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rubysonar: Fatal error compiling: ??Ч??Ŀ??汾?? 1.7 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

License description

"""
License (GNU AGPLv3)

RubySonar - a type inferencer and indexer for Python

Copyright (c) 2013-2014 Yin Wang

"""

It should be "Ruby"

JSONDump usage info is inconsistent with new arg layout

The JSONDump help message says:

$ java -cp target/rubysonar-0.1-SNAPSHOT.jar org.yinwang.rubysonar.JSONDump
Usage: java org.yinwang.rubysonar.dump <source-path> <include-paths> <out-root> [verbose]
  <source-path> is path to source unit (package directory or module file) that will be graphed
  <include-paths> are colon-separated paths to included libs
  <out-root> is the prefix of the output files.  There are 3 output files: <out-root>-doc, <out-root>-sym, <out-root>-ref
  [verbose] if set, then verbose logging is used (optional)

but the code for parsing args expects them in a different order:

        if (args.length >= 3) {
            projectDir = args[0];
            outroot = args[1];
            inclpaths = Arrays.asList(args[2].split(":"));
            srcpath.addAll(Arrays.asList(args).subList(3, args.length));
        } else {
            usage();
            return;
        }

A state safety check for TypeStack

Because you make "typeStack" a static field in Type, I propose a check to fail at mis-operations and (future?) concurrency problem (ah, my own analyzer program is multi-threaded). And so that the method parameters can be taken use of.

We can write TypeStack#pop(...) as below:

    public void pop(Object first, Object second) {
        Pair removed = stack.remove(stack.size() - 1);
        if (removed.first != first || removed.second != second) {
            throw new IllegalStateException("TypeStack is not in its expected state!");
        }
    }

Ruby attribute references

For code as follow

class A
  @f = 0
  def self.f
    @f
  end
end

a = A.new
a.f

it will create a definition for the instance variable f (qname: A::f), and one for the class method (qname: A.f)
however, the reference generated is strange:
f in line 4 referenced to A.f
a.f in last line referenced to A::f

it looks like we want the contrary result

it looks like the reason is: f in line 4 is a Name node, which should really be a attribute node.

and a.f in last line is attribute node, which should be a method call I believe.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.