| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 18 | 2 | 6 | 0.963 | LogicalORExpression |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 18 | 361 | Closure/closure/goog/color/alpha.js |
| 2 | 18 | 391 | Closure/closure/goog/color/alpha.js |
| ||||
function (str){
// Each component is separate (rather than using a repeater) so we can
// capture the match. Also, we explicitly set each component to be either 0,
// or start with a non-zero, to prevent octal numbers from slipping through.
var regExpResultArray= str.match(goog.color.alpha.rgbaColorRe_);
if (regExpResultArray) {
var r= Number(regExpResultArray[1]);
var g= Number(regExpResultArray[2]);
var b= Number(regExpResultArray[3]);
var a= Number(regExpResultArray[4]);
if (r>= 0
&& r<= 255
&&g>= 0
&& g<= 255
&&b>= 0
&& b<= 255
&&a>= 0
&& a<= 1) {
return [r, g, b, a];
}
}
return [ ];
}
|
| ||||
function (str){
// Each component is separate (rather than using a repeater) so we can
// capture the match. Also, we explicitly set each component to be either 0,
// or start with a non-zero, to prevent octal numbers from slipping through.
var regExpResultArray= str.match(goog.color.alpha.hslaColorRe_);
if (regExpResultArray) {
var h= Number(regExpResultArray[1]);
var s= Number(regExpResultArray[2]);
var l= Number(regExpResultArray[3]);
var a= Number(regExpResultArray[4]);
if (h>= 0
&& h<= 360
&&s>= 0
&& s<= 100
&&l>= 0
&& l<= 100
&&a>= 0
&& a<= 1) {
return [h, s, l, a];
}
}
return [ ];
}
|
| |||
function (str)
{
// Each component is separate (rather than using a repeater) so we can
// capture the match. Also, we explicitly set each component to be either 0,
// or start with a non-zero, to prevent octal numbers from slipping through.
var regExpResultArray=str.match(goog.color.alpha. [[#variable6157f2a0]]);
if (regExpResultArray)
{ var [[#variable6157f240]]=Number(regExpResultArray[1]);
var [[#variable6157f1a0]]=Number(regExpResultArray[2]);
var [[#variable6157f100]]=Number(regExpResultArray[3]);
var a=Number(regExpResultArray[4]);
if ( [[#variable6157f240]]>=0
&& [[#variable6157f240]]<= [[#variable6157f080]]
&& [[#variable6157f1a0]]>=0
&& [[#variable6157f1a0]]<= [[#variable6157f000]]
&& [[#variable6157f100]]>=0
&& [[#variable6157f100]]<= [[#variable6157f000]]
&& a>=0
&& a<=1)
{ return [ [[#variable6157f240]], [[#variable6157f1a0]], [[#variable6157f100]],a];
}
}
return [ ];
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#6157f2a0]] | hslaColorRe_ |
| 1 | 2 | [[#6157f2a0]] | rgbaColorRe_ |
| 2 | 1 | [[#6157f240]] | h |
| 2 | 2 | [[#6157f240]] | r |
| 3 | 1 | [[#6157f1a0]] | s |
| 3 | 2 | [[#6157f1a0]] | g |
| 4 | 1 | [[#6157f100]] | l |
| 4 | 2 | [[#6157f100]] | b |
| 5 | 1 | [[#6157f080]] | 360 |
| 5 | 2 | [[#6157f080]] | 255 |
| 6 | 1 | [[#6157f000]] | 100 |
| 6 | 2 | [[#6157f000]] | 255 |