GitonomyCache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIncludingBranches() 0 7 2
1
<?php
2
3
/**
4
 * Helper class caching expensive gitonomy calls
5
 */
6
class GitonomyCache {
7
	public static $cache = array();
8
9
	public static function getIncludingBranches($commit) {
10
		$cacheKey = 'getIncludingBranches-' . $commit->getRepository()->getPath() . '-' . $commit->gethash();
11
		if(!isset(self::$cache[$cacheKey])) {
12
			self::$cache[$cacheKey] = $commit->getIncludingBranches();
13
		}
14
		return self::$cache[$cacheKey];
15
	}
16
}
17