fmbenhassine / jql

Java code analysis and linting with SQL
https://github.com/benas/jql/wiki
MIT License
157 stars 11 forks source link

Column names should be inspired by Java reflection method names #5

Open lukaseder opened 8 years ago

lukaseder commented 8 years ago

Seeing this example statment here:

SELECT i.NAME as name, COUNT(m.ID) as nbMethods
FROM INTERFACE i, METHOD m
WHERE m.TYPE_ID = i.ID GROUP BY i.ID HAVING COUNT(m.ID) > 20;

I'm thinking about how I would best discover these tables as a new user. And I'd probably expect METHOD.DECLARING_CLASS to be the value to use for the join with INTERFACE., not TYPE_ID.

A method has several "types", e.g. annotations, return types, exception types, parameter types, type arguments, etc. So I wouldn't use a generic TYPE_ID to model the declaring class.

fmbenhassine commented 8 years ago

I do agree, without documentation, TYPE_ID can be confusing (BTW, I've added a description of the model here). The column name should be more explicit, something like DECLARING_TYPE_ID.