Giter VIP home page Giter VIP logo

Comments (10)

nerzid avatar nerzid commented on September 10, 2024

Table Structures

MethodTable

mid=> int AUTOINCREMENT PRIMARY KEY
signature => varchar(255)
identifier=> varchar(255)
splitted_identifier=> varchar(255) 
lemma => varchar(255)
postag => varchar(255)
FK_dtid => dtid FOREIGN KEY(FK_dtid) REFERENCES DataType(dtid)

ParameterTable

pgid => int AUTOINCREMENT PRIMARY KEY
identifier => varchar(255)
splitted_identifier => varchar(255)
lemma => varchar(255)
postag => varchar(255)
FK_dtid => int FOREIGN KEY(FK_dtid) REFERENCES DataType(dtid)
FK_mid => int FOREIGN KEY(FK_mid) REFERENCES Method(mid)

DataTypeTable

dtid => int AUTOINCREMENT PRIMARY KEY
identifier => varchar(255)
simplified_identifier => varchar(255)
lemma => varchar(255)
postag => varchar(255)

There is one problem here, this structure assumes all data_types are user-defined. Any ideas to fix this or is it okay to just store not only user-defined ones but every data_type ? That can solve the problem as well. @emineekin

from autocomment.

emineekin avatar emineekin commented on September 10, 2024

Change the table name to "Data types", ignore whether or not it is defined by the user. Simply, for any data type, resolve if necessary and save.
Related to #10

from autocomment.

nerzid avatar nerzid commented on September 10, 2024

Okay, Im working on it.

from autocomment.

emineekin avatar emineekin commented on September 10, 2024

Is there a way to store the original identifiers as well, so that call graph extractor can query using the identifiers as they appear in source code? @nerzid

from autocomment.

nerzid avatar nerzid commented on September 10, 2024

Well, in our db, we have columns; text, lemma, postag, data_type and params .
So a method with identifier such as;

In the text column
insert students into db

Meaning that this is just a lowercased and splitted version. If I want to search this identifier through the source code I can run the following pseudo code.

splittedTextWithoutSpaces = "insertstudentintodb";
if(sourceCode.identifier.toLowerCase().equals(splittedTextWithoutSpaces))
// does something

from autocomment.

nerzid avatar nerzid commented on September 10, 2024

I'll reopen this issue because database need some polishing. I'll close this issue once we make sure that there isn't any problems with database.

from autocomment.

nerzid avatar nerzid commented on September 10, 2024

Im happy with the database right now. See #17 . One important note, the ID's of the tables are just id not mid or dtid or pid because there is a bug in javalite that it sometimes doesn't see method table's id as mid but it sees it like id. Thats why i've changed all table's id attribute as id .

from autocomment.

emineekin avatar emineekin commented on September 10, 2024

One last request:
Can you please just rename the tables? You can change them to Methods, and Parameters and DataTypes for example, or whatever you like.
Because CallGraphExtractor is using Reflection library, which has classes with the same name. And, to be able to query the tables in db using ORM, I must have the same class as the table name, which causes a conflict.
@nerzid

from autocomment.

nerzid avatar nerzid commented on September 10, 2024

Sure, Im on it.

from autocomment.

nerzid avatar nerzid commented on September 10, 2024

I've added "Table" keyword at the end of each table's name. See 6538faa

Method turned into MethodTable and so on ...

from autocomment.

Related Issues (18)

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.