Skip to main content

Week 1

Coding Week 1 Meeting

Date:2021-06-11

Attendees

Current Update

  • Working on populating database for license scanning.
  • Trying different approach to highlight matched text on scanning a code file.

Discussions

  • What is pfile and why are we using it?

    • We are using pfile to keep record of user's input file.
    • It's name is derived by using query.
        select pfile_sha1 || '.' || pfile_md5 ||'.'|| pfile_size AS pfilename from pfile where pfile_pk=___
  • What is license_candidate in ojo databasehandler?

    • license_candidate is used to temporary hold the licenses found by ojo, there can be a case when an invalid license is detected by ojo, it can't be added to license_ref table unless verified.
    • No need to add in scancode databasehandler.
  • What is groupId in ojo databasehandler?

    • groupId is used for the candidate license.
  • After removing +, -or-later here, why are we adding them again here?

    • We don't know what suffix will be used in the license available in the database, so first we remove them from scanned license but in the next block of code we add them so that we can search in database for match.
  • About text highlighting

    • Problem: -
      • Unable to parse the text due to double quote present inside the text string.
      • Using this code to highlight match text, since this code is using string buffer, it has limited size.
    • Solution:
      • I can use escape character to escape double quote in the matched text. But then I have to do this thing again while matching here to highlight.
      • For the second problem, Gaurav suggested to divide the scanned result into a certain range of characters and scan for match.
      • Scancode default JSON output escapes these double quotes and gives valid JSON so Anupam suggested to use that and think about optimising that later. But again I can't use this code.
      • Michael suggested to use line number and transform that to position using number of characters present in a line. (It will be inaccurate as the code file could have irregular number of characters per line.)
      • I asked if I couldn't find anything working then I can talk to Phillip and update about the same.

Conclusion and Further Plans

  • Got clarity about populating database.
  • Find a way for text highlighting problem.
  • Work upon UI for license scanning before the next meeting.