Code Monkey home page Code Monkey logo

Comments (2)

scheb avatar scheb commented on June 12, 2024 1

As we are using the current line call, if we modify the file for any purpose, the line could change so, when we run a new tombstone-analyzer routine we will have one deleted tombstone call and a new one dead call.

That's actually not true. The hash value is only used to deduplicate repeating calls from the same tombstone. That doesn't change anything about weather a tombstone is dead, undead or deleted.

Matching logged tombstone calls to tombstones in the codebase is based on two strategies:

  • Location of the tombstone (file + line + inscription)
  • Context of the tombstone (surrounding method/function + inscription)

If one of those matches, the logged call is assigned to the tombstone. So you can move a tombstone around, as long as one of those criteria stays the same the analyzer would still be able to match it.

Though, if you heavily refactor your codebase (change method names and change code to shift tombstones around), then it can in fact happen, that previously logged tombstone calls are no longer be matched to that tombstone in the code. In that case, the previously logged tombstone calls would show up as deleted and you'd get new tombstones showing up in the report. Once that code is executed and new tombstone calls are being sampled, you should quickly get a refreshed clear picture, which ones are dead and which ones aren't. But for that you have to give the system some time to collect new samples after a heavy refactoring.

If this way of matching is not good or stable enough for you, the idea for custom matching strategies is here, but it hasn't gained much interest yet.

from tombstone.

wprigollopes avatar wprigollopes commented on June 12, 2024

Those two matches look like a good strategy. The only number that could be not exact is the deleted but just in extreme cases. Also, I'm considering that the analyzer needs to be run periodically to have a good summary of the evolution of dead code results and to maintain effective statistics of the code.

Thanks for the clarification.

from tombstone.

Related Issues (15)

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.