CloneSet115


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
6530.951compound_stmt
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1729
BioSQL/DBUtils.py
2655
BioSQL/DBUtils.py
3662
BioSQL/DBUtils.py
4686
BioSQL/DBUtils.py
5693
BioSQL/DBUtils.py
Clone Instance
1
Line Count
7
Source Line
29
Source File
BioSQL/DBUtils.py

    def last_id(self,cursor,table):  
        # XXX: Unsafe without transactions isolation
        table = self.tname(table) 
        sql = "select max(%s_id) from %s"%(table,table) 
        cursor.execute(sql) 
        rv = cursor.fetchone( ) 
        return rv[0] 


Clone Instance
2
Line Count
6
Source Line
55
Source File
BioSQL/DBUtils.py

    def next_id(self,cursor,table):  
        table = self.tname(table) 
        sql = "select nextval('%s_pk_seq')"%table 
        cursor.execute(sql) 
        rv = cursor.fetchone( ) 
        return rv[0] 


Clone Instance
3
Line Count
6
Source Line
62
Source File
BioSQL/DBUtils.py

    def last_id(self,cursor,table):  
        table = self.tname(table) 
        sql = "select currval('%s_pk_seq')"%table 
        cursor.execute(sql) 
        rv = cursor.fetchone( ) 
        return rv[0] 


Clone Instance
4
Line Count
6
Source Line
86
Source File
BioSQL/DBUtils.py

    def next_id(self,cursor,table):  
        table = self.tname(table) 
        sql = "select nextval('%s_pk_seq')"%table 
        cursor.execute(sql) 
        rv = cursor.fetchone( ) 
        return rv[0] 


Clone Instance
5
Line Count
6
Source Line
93
Source File
BioSQL/DBUtils.py

    def last_id(self,cursor,table):  
        table = self.tname(table) 
        sql = "select currval('%s_pk_seq')"%table 
        cursor.execute(sql) 
        rv = cursor.fetchone( ) 
        return rv[0] 


Clone AbstractionParameter Count: 3Parameter Bindings

def [[#variable7c341fc0]](self,cursor,table):
  # XXX: Unsafe without transactions isolation
  table = self.tname(table) 
  sql = [[#variable7c3418e0]]% [[#variable7c341fe0]]
  cursor.execute(sql) 
  rv = cursor.fetchone( ) 
  return rv[0] 
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#7c341fc0]]
last_id 
12[[#7c341fc0]]
next_id 
13[[#7c341fc0]]
last_id 
14[[#7c341fc0]]
next_id 
15[[#7c341fc0]]
last_id 
21[[#7c3418e0]]
"select currval('%s_pk_seq')" 
22[[#7c3418e0]]
"select nextval('%s_pk_seq')" 
23[[#7c3418e0]]
"select max(%s_id) from %s" 
24[[#7c3418e0]]
"select nextval('%s_pk_seq')" 
25[[#7c3418e0]]
"select currval('%s_pk_seq')" 
31[[#7c341fe0]]
table 
32[[#7c341fe0]]
table 
33[[#7c341fe0]]
(table,table) 
34[[#7c341fe0]]
table 
35[[#7c341fe0]]
table