Skip to content

Lucene index fields

Amy Brennan-Luna edited this page Nov 8, 2020 · 4 revisions

Tip: Apache Lucene is used to index the information and files will be automatically updated as they are changed. This allows instant lookups of information, such as for finding unused code

Document fields

  • Class - name of class
  • Method - name of method
  • Element - name of element (such as method name, field name)
    • How should I represent method invocations?
  • Type
    • Class
    • Method
    • Field
    • Parameter
    • Local variable

Plans for info

  • Trace where info is set (this is the "discover" part of the plugin)
    • For example, if have a web application, would want to be able to determine what code effects what the displayed value is
    • Ideally would be able to trace back to the database
    • Then, would see any transformations
    • The code knows this, since when it's executed, you get the result
    • The goal is to show you what code touches the displayed value
    • Frequently when I'm troubleshooting a web application at work, I need to be able to answer the question "what code is part of the creation of a displayed value"
    • The main goal of DYCE is for the code to tell me the answer to this question, reducing the amount of time I spend manually analyzing the code
    • The code should tell a story and the goal is to discover how everything is linked (I called this functionality StoryLink)
  • Detect unused code
    • Already wrote tool and would see how to adapt to plugin
    • Would add ability to ignore certain things (I would implement what I need for my current unused tool and add more over time)
  • Call hierarchy
    • Already wrote tool for downstream and would see how to adapt to plugin
    • Upstream / downstream calls
    • No upstream calls means that the code is unused

Info I want to store

  • Method invocations
  • Parameters
  • Local variables

Info I want to store about variables

  • Scope (such as if within a specific "if" or "for" block
  • Effectively final? (useful for Streams; there's a field)
  • "Constant" (JDT has way to get value)
  • Assignments (include each)
    • Initialization
    • Later assignments
  • In the future, want to also indicate when a method is
    • Read (dereferenced with no side effects)
      • For example, list.get
    • Dereferenced (if cannot determine if read / write)
    • Write (dereferenced with side effects)
      • For example, list.add / list.set
    • Assign (an assignment)

Clone this wiki locally