.NAME Similarities not allowed in source code

.DESCRIPTION
No similarities allowed in the source code files.

.SEVERITY Advisory

.COMMAND reducer

.CODE

proc compute {mnemo prj params} {
    if {![llength $params] == 2} {
        error "Rule $mnemo can not be used without parameters."
    }
    set cfg [red_obj::get_config_from_param $prj $params]
    if {![string length $cfg]} {
        error "Rule $mnemo: Can not find a built configuration for parameter : $params."
    }
    
    set idx 0 
    foreach sim [red_obj::get_config_filtered_sorted_similarities $cfg] {
        incr idx
        foreach inst [red_obj::get_similarity_instances $sim] {
            set path [red_obj::get_file_path [red_obj::get_instance_ifile $inst]]
			set firstLine [red_obj::get_instance_first_line $inst]
			set lastLine [red_obj::get_instance_last_line $inst]
			api::add_rule_violation $path $firstLine "[red_obj::get_config_acronym $cfg] - Similarity-${idx}: lines $firstLine to $lastLine"
		}
	}
}

