You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an example of the SQL code I am talking about...
constexpress=require("express");constrouter=express.Router();router.get("/api/categories",async(req,res,next)=>{try{letrequest=req.app.locals.pool.request();letquery=` select cast(acClassif as nvarchar(255)) categoryKey, cast(acName as nvarchar(255)) categoryName from tHE_SetItemCateg where acType = 'P' `;letresult=awaitrequest.query(query);letfinal=result.recordset;res.send(final);}catch(err){next(err);}});module.exports=router;
The SQL in the string is not counted at all.
This is probably impossible to pull off, I just wanted to point it out.
It could be made easier if we declare the language used. Ex.
letquery=/*sql*/` -- sql select cast(acClassif as nvarchar(255)) categoryKey, cast(acName as nvarchar(255)) categoryName from tHE_SetItemCateg where acType = 'P'`;
The text was updated successfully, but these errors were encountered:
So... this is possible to do, and I think tokei does to an extent for things like markdown files by looking for the embedding as you have in the above.
I know tools like intellij can do this, so perhaps whatever technique they use (they do parse the code but that shouldn't give sql information) might be something to copy. Something to investigate there.
Not saying no to this, just not sure how to go about doing it yet.
My naive approach would be to "tag" the string with a comment, and count the lines inside the quotes, as if they were regular lines in a regular file. The same logic used for the files can be applied to the string text.
I really appreciate and am grateful for the existing features, and this was just something I wanted to mention, if you felt bored xD.
Hah bored... sometimes. What I really want to do is bring in the changes I have been working on to have correct .gitignore support. Soon. Then I can get some other bugs sorted out.
I tried
scc
on my project and I like what it outputs.What I've noticed is that it gives me 90 SQL lines (those in
.sql
files), while the app has almost the same amount of SQL (in strings) as Javascript.Here's an example of the SQL code I am talking about...
The SQL in the string is not counted at all.
This is probably impossible to pull off, I just wanted to point it out.
It could be made easier if we declare the language used. Ex.
The text was updated successfully, but these errors were encountered: