SEM007 : Statement metrics for detecting duplicated code |
![]() |



The rule has a Batch scope and is applied only on the SQL script.

Rule has no parameters.

The rule does not need Analysis Context or SQL Connection.


Metrics

There is no additional info for this rule.

SQL
1begin 2-- non-ANSI inner join syntax: 3SELECT a.au_id , 4 t.titlr e 5FROM titles AS t , 6 authors AS a , 7 titleauthor AS ta 8WHERE a.au_id = ta.au_id 9 AND ta.title_id = t.title_id 10 AND t.title LIKE 'Example%' 11 12-- ANSI inner join syntax: 13 14/* 15SELECT a.au_id , 16 t.title 17FROM authors AS a 18INNER JOIN titleauthor AS ta 19ON a.au_id = ta.au_id 20INNER JOIN titles AS t 21ON ta.title_id = t.title_id 22WHERE t.title LIKE 'Example%'*/ 23 24 25SELECT a.au_id , 26 t.title 27FROM authors AS a 28INNER JOIN titleauthor AS ta 29ON a.au_id = ta.au_id 30INNER JOIN titles AS t 31ON ta.title_id = t.title_id 32WHERE t.title LIKE 'Example%' -- Ignore 33 34SELECT a.au_id , 35 t.title 36FROM authors AS a 37INNER JOIN titleauthor AS ta 38 39 40 41 42ON a.au_id = ta.au_id 43INNER JOIN titles AS t 44ON ta.title_id = t.title_id 45WHERE t.title LIKE 'Example%' -- Ignore 46 47 48end |

Message | Line | Column | |
---|---|---|---|
1 | SEM007 : Hash=BCC52F87,Statements=4,Tokens=138,Lines=48,Position=1,StatementLength=1026 | 1 | 0 |
2 | SEM007 : Hash=F01E538,Statements=1,Tokens=43,Lines=21,Position=2,StatementLength=495 | 3 | 0 |
3 | SEM007 : Hash=EA388B09,Statements=1,Tokens=45,Lines=8,Position=3,StatementLength=233 | 25 | 0 |
4 | SEM007 : Hash=EA388B09,Statements=1,Tokens=45,Lines=12,Position=4,StatementLength=241 | 34 | 0 |
