CloneSet305


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
26240.952StatementList[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
126115
Closure/closure/goog/dom/selection.js
225384
Closure/closure/goog/dom/selection.js
Clone Instance
1
Line Count
26
Source Line
115
Source File
Closure/closure/goog/dom/selection.js

  // Text within the selection , e.g. "" assuming that the cursor is just after
  // the \r\n combination.
  var selectionText=  selectionRange.text;
  // Text within the selection, e.g.,  "" (this will later include the \r\n
  // sequences also)
  var untrimmedSelectionText=  selectionText;

  // Boolean indicating whether we are done dealing with the text before the
  // selection's beginning.
  var isRangeEndTrimmed=  false;
  // Go over the range until it becomes a 0-lengthed range or until the range
  // text starts changing when we move the end back by one character.
  // If after moving the end back by one character, the text remains the same,
  // then we need to add a "\r\n" at the end to get the actual text.
  while (!isRangeEndTrimmed) {
    if (range.compareEndPoints('StartToEnd', range)==  0) {
      isRangeEndTrimmed=  true;
                                                          }
    else   {
      range.moveEnd('character', -1);
      if (range.text==  beforeSelectionText) {
        // If the start position of the cursor was after a \r\n string,
        // we would skip over it in one go with the moveEnd call, but
        // range.text will still show "Hello" (because of the IE range.text
        // bug) - this implies that we should add a \r\n to our
        // untrimmedBeforeSelectionText string.
        untrimmedBeforeSelectionText+=  '\r\n';
                                             }
      else   {
        isRangeEndTrimmed=  true;
             }
           }
                             }


Clone Instance
2
Line Count
25
Source Line
384
Source File
Closure/closure/goog/dom/selection.js

  // Text within the selection , e.g. "o" assuming that the cursor is just after
  // the \r\n combination.
  var selectionText=  selectionRange.text;
  // Text within the selection, e.g.,  "o" (this will later include the \r\n
  // sequences also)
  var untrimmedSelectionText=  selectionText;

  // Boolean indicating whether we are done dealing with the text inside the
  // selection.
  var isSelectionRangeEndTrimmed=  false;
  // Go over the selected range until it becomes a 0-lengthed range or until
  // the range text starts changing when we move the end back by one character.
  // If after moving the end back by one character, the text remains the same,
  // then we need to add a "\r\n" at the end to get the actual text.
  while (!isSelectionRangeEndTrimmed) {
    if (selectionRange.compareEndPoints('StartToEnd', selectionRange)==  0) {
      isSelectionRangeEndTrimmed=  true;
                                                                            }
    else   {
      selectionRange.moveEnd('character', -1);
      if (selectionRange.text==  selectionText) {
        // If the selection was not empty, and the end point of the selection
        // was just after a \r\n, we would have skipped it in one go with the
        // moveEnd call, and this implies that we should add a \r\n to the
        // untrimmedSelectionText string.
        untrimmedSelectionText+=  '\r\n';
                                                }
      else   {
        isSelectionRangeEndTrimmed=  true;
             }
           }
                                      }


Clone AbstractionParameter Count: 4Parameter Bindings

// Text within the selection , e.g. "" assuming that the cursor is just after
// Text within the selection , e.g. "o" assuming that the cursor is just after
// the \r\n combination.
var selectionText=selectionRange.text;
// Text within the selection, e.g.,  "" (this will later include the \r\n
// Text within the selection, e.g.,  "o" (this will later include the \r\n
// sequences also)
var untrimmedSelectionText=selectionText;
// Boolean indicating whether we are done dealing with the text before the
// selection's beginning.
// Boolean indicating whether we are done dealing with the text inside the
// selection.
var [[#variable61b516a0]]= false;
// Go over the range until it becomes a 0-lengthed range or until the range
// text starts changing when we move the end back by one character.
// Go over the selected range until it becomes a 0-lengthed range or until
// the range text starts changing when we move the end back by one character.
// If after moving the end back by one character, the text remains the same,
// then we need to add a "\r\n" at the end to get the actual text.
while (! [[#variable61b516a0]])
  { if ( [[#variable572332e0]].compareEndPoints('StartToEnd', [[#variable572332e0]])==0)
      {  [[#variable61b516a0]]= true;
      }
    else
      {  [[#variable572332e0]].moveEnd('character',-1);
        if ( [[#variable572332e0]].text== [[#variable623ab5e0]])
          {  [[#variable5bc374e0]]+='\r\n';
          }
        else
          {  [[#variable61b516a0]]= true;
          }
      }
  }
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#61b516a0]]
isRangeEndTrimmed 
12[[#61b516a0]]
isSelectionRangeEndTrimmed 
21[[#572332e0]]
range 
22[[#572332e0]]
selectionRange 
31[[#623ab5e0]]
beforeSelectionText 
32[[#623ab5e0]]
selectionText 
41[[#5bc374e0]]
// If the start position of the cursor was after a \r\n string,
// we would skip over it in one go with the moveEnd call, but
// range.text will still show "Hello" (because of the IE range.text
// bug) - this implies that we should add a \r\n to our
// untrimmedBeforeSelectionText string.
untrimmedBeforeSelectionText 
42[[#5bc374e0]]
// If the selection was not empty, and the end point of the selection
// was just after a \r\n, we would have skipped it in one go with the
// moveEnd call, and this implies that we should add a \r\n to the
// untrimmedSelectionText string.
untrimmedSelectionText