| Type | Line | Description |
|---|---|---|
| 51 | filtering only non-zero value | |
| 62 | only the order is interesting, I'm not Google |
| Type | Line | Description |
|---|---|---|
| 31 | we search for methods declared in interfaces | |
| 35 | scan for all parameters | |
| 38 | we find a param, we scan for type hint | |
| 41 | we find a typed parameter with a class : evil | |
| 42 | we add the shortcut path (skip the parameter, not relevant) | |
| 50 | I love this ^o^ |
| Type | Line | Description |
|---|---|---|
| 56 | en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm | |
| 73 | not found => hidden coupling : | |
| 74 | source is impl and target is method |
| Type | Line | Description |
|---|---|---|
| 29 | for each class | |
| 32 | we have a method first declared in a class | |
| 33 | we search for calls to that method | |
| 40 | we search for the owning class of that impl | |
| 44 | we found the owning class vertex of $impl | |
| 45 | add edges to reduced graph | |
| 55 | arf |
| Type | Line | Description |
|---|---|---|
| 33 | checking if the path go through a call before finding a class | |
| 38 | since I build an arborescence on class | |
| 39 | vertices, I stop on the first encountered class |
| Type | Line | Description |
|---|---|---|
| 32 | since I build an arborescence on class | |
| 33 | vertices, I stop on the first encountered class |
| Type | Line | Description |
|---|---|---|
| 33 | checking if the path go through on implementation | |
| 44 | since I build an arborescence on class | |
| 45 | vertices, I stop on the first encountered class |
| Type | Line | Description |
|---|---|---|
| 32 | load | |
| 34 | all this stuff is not really necessary but this component is kewl | |
| 35 | and I want to use it. | |
| 36 | A better configuration handling => better programing | |
| 42 | validates |
| Type | Line | Description |
|---|---|---|
| TODO | 22 | Make it abstract and use mockup to test it by Hell ! |
| Type | Line | Description |
|---|---|---|
| 43 | if the vetex is already in the the adjacencies list, there is no | |
| 44 | need to add it. | |
| 46 | if it is not found, we add it (with empty edge list) | |
| 65 | if there is not already a directed edge between those two vertices | |
| 66 | we drop the stacking |
| Type | Line | Description |
|---|---|---|
| 17 | en.wikipedia.org/wiki/Power_iteration | |
| 28 | en.wikipedia.org/wiki/Eigenvector_centrality#Eigenvector_centrality | |
| 52 | result = M . approx | |
| 59 | very suspicious | |
| 60 | what if we invert $v and $succ, isn't the reversed digraph ? | |
| 63 | calc the norm | |
| 71 | normalize |
| Type | Line | Description |
|---|---|---|
| 25 | for isolated vertex : | |
| 27 | we reverse each edge : |
| Type | Line | Description |
|---|---|---|
| 29 | en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm | |
| 32 | code.google.com/p/jbpt/source/browse/trunk/jbpt-core/src/main/java/org/jbpt/algo/graph/StronglyConnectedComponents.java | |
| 58 | Consider successors of v | |
| 61 | Successor w has not yet been visited; recurse on it | |
| 65 | Successor w is in stack S and hence in the current SCC | |
| 69 | If v is a root node, pop the stack and generate an SCC |
| Type | Line | Description |
|---|---|---|
| 29 | trismegiste.github.io/Mondrian/'; | |
| 63 | www.graphviz.org to know more |
| Type | Line | Description |
|---|---|---|
| 22 | finds which class must be refactored (and add inheritance) | |
| 24 | replaces the parameters types with the interface | |
| 26 | creates the new interface file |
| Type | Line | Description |
|---|---|---|
| 19 | for all platforms | |
| 30 | stdin is a pipe | |
| 31 | stdout is a pipe | |
| 32 | stderr is also a pipe |
| Type | Line | Description |
|---|---|---|
| 51 | Per-type markers, as they don't inherit styles. | |
| 91 | Use elliptical arc path segments to doubly-encode directionality. |
| Type | Line | Description |
|---|---|---|
| 78 | default declarer : | |
| 86 | higher parent ? | |
| 100 | @todo recursion for use trait in trait | |
| 102 | @todo for trait, we need a recursion | |
| 105 | in fact this all method is a recursion with a getImportedMethod() | |
| 107 | @todo alias ! Because of Alias, a trait does not own its | |
| 108 | declaration. An existing trait in a class does not give | |
| 109 | you any information about its contract since the class | |
| 110 | could rename each trait's method | |
| 135 | higher parent ? | |
| 155 | this is a security since I'm changing the API | |
| 234 | class $classname is using the trait $fqcn, now | |
| 235 | is the method first declared in this class ? | |
| 237 | ok we can add $classname to the returned list |
| Type | Line | Description |
|---|---|---|
| 17 | I didn't add the classname for 2 reasons : much clearer | |
| 18 | and since there can be false positive on calls with same | |
| 19 | name, adding the name can be more confusing |
| Type | Line | Description |
|---|---|---|
| 19 | because traits are in he same place as rainbow and unicorn : it's magic so: pentagon & pink |
| Type | Line | Description |
|---|---|---|
| 29 | since we only track the public method, we check we are in : | |
| 48 | edge for use trait | |
| 114 | managing params of the signature : | |
| 116 | adding edge from signature to param : | |
| 119 | now the type of the param : | |
| 122 | there is a type, we add a link to the type, if it is found | |
| 125 | we add the edge | |
| 143 | who is embedding the impl ? | |
| 149 | in any case, we link the implementation to the params | |
| 151 | adding edge from signature to param : | |
| 153 | it is possible to not find the param because the signature | |
| 154 | is external to the source code : | |
| 179 | search for the declaring class of this method | |
| 182 | if current class == declaring class, we add the edge | |
| 190 | search for the declaring class of this method | |
| 193 | if current class == declaring class, we add the edge | |
| 197 | if not abstract, the implementation depends on the class. | |
| 198 | For odd reason, a method in an interface is not abstract | |
| 199 | that's why, there is a double check | |
| 207 | edge between impl and trait : | |
| 213 | edges between impl towards param (with typed param) | |
| 215 | adding edge from implementation to param : | |
| 218 | now the type of the param : | |
| 221 | there is a type, we add a link to the type, if it is found | |
| 224 | we add the edge | |
| 230 | edge between class vertex which using the trait and copy-pasted methods : | |
| 233 | we link the class and the signature | |
| 237 | and copypasted signature to unique parameter | |
| 253 | implements | |
| 269 | extends | |
| 275 | implements | |
| 318 | skipping $this : | |
| 320 | nothing to call | |
| 323 | checking if the called is a method param | |
| 333 | is it a typed param ? | |
| 336 | we check if it is an outer class or not : is it known ? | |
| 345 | can't see shit captain | |
| 361 | skipping some obvious calls : | |
| 363 | searching a candidate for $called::$method | |
| 364 | I think there is a chain of responsibility beneath that : | |
| 367 | fallback : link to every methods with the same name : | |
| 371 | store the fallback for futher report | |
| 378 | fallback or not, we exclude calls from annotations | |
| 421 | it's possible to not find a trait if it is from an external library for example | |
| 422 | or could be dead code too |
| Type | Line | Description |
|---|---|---|
| 36 | if the visitor is used without PhpFile nodes | |
| 48 | resetting the tracking of namespace and alias if we enter in a new file | |
| 80 | don't resolve special class names | |
| 85 | fully qualified names are already resolved | |
| 90 | resolve aliases (for non-relative names) | |
| 93 | if no alias exists prepend current namespace |
| Type | Line | Description |
|---|---|---|
| 19 | a list of PhpFile | |
| 20 | a temporary stack of methods for the currently new interface | |
| 101 | I filter only good relevant methods (no __construct, __clone, __invoke ...) |
| Type | Line | Description |
|---|---|---|
| 56 | generate | |
| 122 | to prevent cloning in Traverser (workaround) : | |
| 139 | only refactor a method if it contains more than 1 statements (would be pointless otherwise, IMO) | |
| 159 | @todo creating a new protected factory for a trait makes sense |
| Type | Line | Description |
|---|---|---|
| 131 | if there are annotations, we add them to the node |
| Type | Line | Description |
|---|---|---|
| 52 | extends | |
| 58 | implements | |
| 72 | extends | |
| 103 | @todo do not forget aliases |
| Type | Line | Description |
|---|---|---|
| 59 | create implemenation node | |
| 60 | if not abstract we add the vertex for the implementation | |
| 65 | push param for implementation | |
| 71 | copy paste this signature in every class which use this current trait | |
| 72 | Anyway we check if there is no other parent which declaring first this method | |
| 75 | we copy-paste the signature declaration in the class which using the current trait | |
| 87 | if this class is declaring the method, we create a vertex for this signature | |
| 93 | if not abstract we add the vertex for the implementation | |
| 101 | if this interface is declaring the method, we create a vertex for this signature | |
| 123 | now param |