jpeek icon indicating copy to clipboard operation
jpeek copied to clipboard

Skeleton is broken: no way to tell what a class inherits from its parent

Open llorllale opened this issue 8 years ago • 14 comments

We currently can't tell whether a field or method defined in a superclass and being accessed from a subclass method is actually inherited.

This is relevant for some metrics, eg. TCC. On the topic of Inheritance and Cohesion, the TCC metric says:

A subclass inherits methods and instance variables from its superclass(es). We have several options for evaluating cohesion of a subclass. We can (1) include all inherited components in the subclass in our evaluation, (2) include only methods and instance variables defined in the subclass, or (3) include inherited instance variables but not inherited methods. The class cohesion measures that we develop can be applied using any one of these options.

llorllale avatar Feb 15 '18 14:02 llorllale

@yegor256/z please, pay attention to this issue

0crat avatar Feb 15 '18 14:02 0crat

@llorllale you are saying that we need some markers for attributes and methods, that will tell us which of them are inherited from a super class. Correct?

yegor256 avatar Feb 15 '18 17:02 yegor256

@yegor256 I think we can have either, a) xsd:attribute on class indicating its superclass, or b) xsd:boolean on attributes+methods indicating if they're inherited

Any of those would work I guess.

llorllale avatar Feb 15 '18 18:02 llorllale

@llorllale I think we need four things

  • class/parent
  • class/interfaces/interface
  • class/methods/method/@inherited
  • class/attributes/attribute/@inherited

Agree?

yegor256 avatar Feb 16 '18 16:02 yegor256

@yegor256 for the purposes I stated in the description, I would just need method/@inherited and attribute/@inherited (assuming they're xsd:boolean).

But if you are planning on adding all those, my question is: how would I know from what I inherited the method or attribute from? The parent or one of the interfaces?

llorllale avatar Feb 17 '18 14:02 llorllale

@llorllale we don't need to know that, right? Just boolean attributes will be enough?

yegor256 avatar Feb 17 '18 16:02 yegor256

@yegor256 correct. For now, just boolean attributes on <method> and <attribute> will be enough

llorllale avatar Feb 17 '18 16:02 llorllale

Job #187 is now in scope, role is DEV

0crat avatar Feb 19 '18 13:02 0crat

Bug was reported, see §29: +15 points just awarded to @llorllale/z, total is +620

0crat avatar Feb 19 '18 13:02 0crat

The job #187 assigned to @mesut/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be a monetary reward for this job

0crat avatar Jul 06 '18 11:07 0crat

@mesut/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

0crat avatar Jul 11 '18 13:07 0crat

@0crat wait

mesut avatar Jul 16 '18 10:07 mesut

@0crat wait (here)

@mesut The impediment for #187 was registered successfully by @mesut/z

0crat avatar Jul 16 '18 10:07 0crat

The architect of the project has changed; @yegor256/z is not at this role anymore; @paulodamaso/z is the architect now

0crat avatar Dec 14 '18 13:12 0crat