Quintiq file version 2.0 
 | 
#parent: #root 
 | 
MethodOverride CreateIssue (LibOpt_SuboptimizerScopeElement suboptimizerscopeelement, String issuetype, const constcontent LibOpt_StatisticSeverityScaleEntrys severityscaleentries_lowerthresholdviolation,  
 | 
  const constcontent LibOpt_StatisticSeverityScaleEntrys severityscaleentries_upperthresholdviolation) 
 | 
{ 
 | 
  Description: 'Create a `LibOpt_Issue` for the given "suboptimizer scope element" (`LibOpt_SuboptimizerScopeElement`) if its `LibOpt_SuboptimizerScopeElement.InputPercentage` violates the `LowerThreshold` / `UpperThreshold` of this statistic.' 
 | 
  TextBody: 
 | 
  [* 
 | 
    // Variables needed for Issues creation. 
 | 
    shouldcreateissue := false; 
 | 
    severity := 0.0; 
 | 
     
 | 
    if( suboptimizerscopeelement.InputPercentage() < this.LowerThreshold() or suboptimizerscopeelement.InputPercentage() = 0 ) 
 | 
    { 
 | 
      shouldcreateissue := true; 
 | 
       
 | 
      severity := this.GetSeverity( suboptimizerscopeelement.InputPercentage(), false /*is upper threshold violation*/, severityscaleentries_lowerthresholdviolation ); 
 | 
    } 
 | 
    else if( suboptimizerscopeelement.InputPercentage() > this.UpperThreshold() ) 
 | 
    { 
 | 
      shouldcreateissue := true; 
 | 
       
 | 
      severity := this.GetSeverity( suboptimizerscopeelement.InputPercentage(), true /*is upper threshold violation*/, severityscaleentries_upperthresholdviolation ); 
 | 
    } 
 | 
     
 | 
    if( shouldcreateissue ) 
 | 
    { 
 | 
      // Create an Issue and link it with the relevant Suboptimizer Scope Element. 
 | 
      LibOpt_Issue::Create( this, 
 | 
                            suboptimizerscopeelement, 
 | 
                            issuetype, 
 | 
                            this.Focus() + ', ' + suboptimizerscopeelement.ScopeElement().Identifier(), 
 | 
                            severity, 
 | 
                            Translations::LibOpt_Issue_Details_ScopeElementInput( suboptimizerscopeelement.InputPercentage(), 
 | 
                                                                                  this.LowerThreshold(), 
 | 
                                                                                  this.UpperThreshold(), 
 | 
                                                                                  LibOpt_Statistic::GetFormat( suboptimizerscopeelement.InputPercentage(), 
 | 
                                                                                                               this.LowerThreshold(), 
 | 
                                                                                                               this.UpperThreshold() ) ) 
 | 
                          ); 
 | 
    } 
 | 
  *] 
 | 
} 
 |