If this rule is a CSS rule (not a mixin declaration) and if an guard exists if it true.

@param formatter the CCS target
@return true, if a CSS rule
511462
private boolean isValidCSS( CssFormatter formatter ) {
        if( params == null ) {
            if( guard != null ) {
                //CSS Guards
//                guard = ValueExpression.eval( formatter, guard );
                return guard.booleanValue( formatter );
            }
            return true;
        }
        return false;
    }
1077587
public static boolean isOverlay(Element element) {

        for (String overlayClass : Arrays.asList(
            I_CmsLayoutBundle.INSTANCE.containerpageCss().expiredOverlay(),
            CmsElementOptionBar.CSS_CLASS)) {
            if (element.hasClassName(overlayClass)) {
                return true;
            }
        }
        return false;

    }
45620
public static <S> Matcher<S> is(Matcher<S> matcher) {
        return Matchers.is(matcher);
    }
454233
boolean rule1(final IFactory factory, final Inclusion[] gcis) {
        boolean result = false;

        // TODO: make this "binarisation" more efficient by doing it for all
        // elements rather than relying on multiple calls to this rule and 
        // stripping off one Role for each call.
        if (lhs.length > 2) {
            result = true;

            final int k = lhs.length - 1;
            int[] newLhs1 = new int[k];
            System.arraycopy(lhs, 0, newLhs1, 0, newLhs1.length);
            int u = factory.getRole(newLhs1);

            int[] newLhs2 = { u, lhs[k] };

            gcis[0] = new RI(newLhs1, u);
            gcis[1] = new RI(newLhs2, rhs);
        }

        return result;
    }
1294012
public function isValidTransformer($transformer): bool
    {
        if ($transformer instanceof TransformerInterface) {
            return true;
        }

        if (\is_callable($transformer)) {
            return true;
        }

        return false;
    }
960926
protected boolean validate(Validator validator, UIObject ui) {

        if (notifiedWidgets.containsKey(validator))
            ui = notifiedWidgets.get(validator);

        String msg = validator.validate();
        if (msg == null || msg.length() == 0) {
            validationStyles(validator, null, ui, true);
            return true;
        } else {
            validationStyles(validator, msg, ui, false);
            return false;
        }
    }
310478
@Override
    public CompareAssert withComparisonFormatter(ComparisonFormatter formatter) {
        this.formatter = formatter;
        diffBuilder.withComparisonFormatter(formatter);
        return this;
    }
314791
protected function hasValidator(Validator $validator) : bool
    {
        $hash = spl_object_hash($validator);

        return isset($this->validators[$hash]);
    }
1315864
public boolean cchanged(String descriptor) {
		if (liveVersion != null) {
			boolean b = liveVersion.hasConstructorChanged(descriptor);
			return b;
		}
		return false;
	}
1027376
private void eval( CssFormatter formatter ) {
        try {
            switch( super.toString().toLowerCase() ) {
                case "": //parenthesis
                    if( parameters.size() > 1 ) {
                        throw ((LessObject)get( 0 )).createException( "Unrecognized input" );
                    }
                    evalParam( 0, formatter );
                    return;
                case "percentage":
                    type = PERCENT;
                    doubleValue = getDouble( 0, formatter ) * 100;
                    return;
                case "convert":
                    type = NUMBER;
                    String unit = get( 1 ).stringValue( formatter );
                    Expression param = get( 0 );
                    doubleValue = param.doubleValue( formatter ) * Operation.unitFactor( param.unit( formatter ), unit, false );
                    return;
                case "abs":
                    type = getNumberDataType( formatter );
                    doubleValue = Math.abs( getDouble( 0, formatter ) );
                    return;
                case "ceil":
                    type = getNumberDataType( formatter );
                    doubleValue = Math.ceil( getDouble( 0, formatter ) );
                    return;
                case "floor":
                    type = getNumberDataType( formatter );
                    doubleValue = Math.floor( getDouble( 0, formatter ) );
                    return;
                case "mod":
                    type = NUMBER;
                    doubleValue = getDouble( 0, formatter ) % getDouble( 1, formatter );
                    return;
                case "pi":
                    type = NUMBER;
                    doubleValue = Math.PI;
                    return;
                case "round":
                    type = getNumberDataType( formatter );
                    int decimalPlaces = getInt( 1, 0, formatter );
                    doubleValue = getDouble( 0, formatter );
                    for( int i = 0; i < decimalPlaces; i++ ) {
                        doubleValue *= 10;
                    }
                    doubleValue = Math.round( doubleValue );
                    for( int i = 0; i < decimalPlaces; i++ ) {
                        doubleValue /= 10;
                    }
                    return;
                case "min":
                    type = NUMBER;
                    doubleValue = get( 0 ).doubleValue( formatter );
                    unit = unit( formatter );
                    for( int i = 1; i < parameters.size(); i++ ) {
                        param = parameters.get( i );
                        doubleValue = Math.min( doubleValue, param.doubleValue( formatter ) / Operation.unitFactor( unit, param.unit( formatter ), true ) );
                    }
                    return;
                case "max":
                    type = NUMBER;
                    doubleValue = get( 0 ).doubleValue( formatter );
                    unit = unit( formatter );
                    for( int i = 1; i < parameters.size(); i++ ) {
                        param = parameters.get( i );
                        doubleValue = Math.max( doubleValue, param.doubleValue( formatter ) / Operation.unitFactor( unit, param.unit( formatter ), true ) );
                    }
                    return;
                case "sqrt":
                    type = NUMBER;
                    doubleValue = Math.sqrt( getDouble( 0, formatter ) );
                    return;
                case "pow":
                    type = NUMBER;
                    doubleValue = Math.pow( getDouble( 0, formatter ), getDouble( 1, formatter ) );
                    return;
                case "sin":
                    type = NUMBER;
                    doubleValue = Math.sin( getRadians( formatter ) );
                    return;
                case "cos":
                    type = NUMBER;
                    doubleValue = Math.cos( getRadians( formatter ) );
                    return;
                case "tan":
                    type = NUMBER;
                    doubleValue = Math.tan( getRadians( formatter ) );
                    return;
                case "acos":
                    type = NUMBER;
                    doubleValue = Math.acos( getRadians( formatter ) );
                    return;
                case "asin":
                    type = NUMBER;
                    doubleValue = Math.asin( getRadians( formatter ) );
                    return;
                case "atan":
                    type = NUMBER;
                    doubleValue = Math.atan( getRadians( formatter ) );
                    return;
                case "increment":
                    type = NUMBER;
                    doubleValue = getDouble( 0, formatter ) + 1;
                    return;
                case "add":
                    type = NUMBER;
                    doubleValue = getDouble( 0, formatter ) + getDouble( 1, formatter );
                    return;
                case "length":
                    type = NUMBER;
                    doubleValue = getParamList( formatter ).size();
                    return;
                case "extract":
                    extract( formatter );
                    return;
                case "range":
                    type = LIST;
                    return;
                case "alpha":
                    type = NUMBER;
                    switch( get( 0 ).getDataType( formatter ) ) {
                        case RGBA:
                            doubleValue = alpha( getDouble( 0, formatter ) );
                            break;
                        case COLOR:
                            doubleValue = 1;
                            break;
                        default:
                            type = STRING;
                    }
                    return;
                case "red":
                    type = NUMBER;
                    doubleValue = red( getDouble( 0, formatter ) );
                    return;
                case "green":
                    type = NUMBER;
                    doubleValue = green( getDouble( 0, formatter ) );
                    return;
                case "blue":
                    type = NUMBER;
                    doubleValue = blue( getDouble( 0, formatter ) );
                    return;
                case "rgba":
                    type = RGBA;
                    int r = getColorDigit( 0, formatter );
                    int g = getColorDigit( 1, formatter );
                    int b = getColorDigit( 2, formatter );
                    double a = getPercent( 3, formatter );
                    doubleValue = rgba( r, g, b, a );
                    return;
                case "rgb":
                    type = COLOR;
                    r = getColorDigit( 0, formatter );
                    g = getColorDigit( 1, formatter );
                    b = getColorDigit( 2, formatter );
                    doubleValue = rgb( r, g, b );
                    return;
                case "color":
                    param = get( 0 );
                    String str = UrlUtils.removeQuote( param.stringValue( formatter ) );
                    doubleValue = getColor( new ValueExpression( param, str ), formatter );
                    return;
                case "argb":
                    type = STRING;
                    return;
                case "saturate":
                    type = COLOR;
                    HSL hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.s += getPercent( 1, formatter );
                    doubleValue = hsla( hsl );
                    return;
                case "desaturate":
                    type = COLOR;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.s -= getPercent( 1, formatter );
                    doubleValue = hsla( hsl );
                    return;
                case "greyscale":
                    type = COLOR;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.s = 0;
                    doubleValue = hsla( hsl );
                    return;
                case "mix":
                    double c1 = getColor( 0, formatter );
                    double c2 = getColor( 1, formatter );
                    double weight = getPercent( 2, 0.5, formatter );
                    doubleValue = mix( c1, c2, weight );
                    return;
                case "tint":
                    c1 = getColor( 0, formatter );
                    weight = getPercent( 1, 0.5, formatter );
                    doubleValue = mix( WHITE, c1, weight );
                    return;
                case "shade":
                    c1 = getColor( 0, formatter );
                    weight = getPercent( 1, 0.5, formatter );
                    doubleValue = mix( BLACK, c1, weight );
                    return;
                case "saturation":
                    type = PERCENT;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    doubleValue = hsl.s * 100;
                    return;
                case "hsl":
                    type = COLOR;
                    doubleValue = hsla( getDouble( 0, formatter ), getPercent( 1, formatter ), getPercent( 2, formatter ), 1 );
                    return;
                case "hsla":
                    type = RGBA;
                    doubleValue = hsla( getDouble( 0, formatter ), getPercent( 1, formatter ), getPercent( 2, formatter ), getPercent( 3, formatter ) );
                    return;
                case "hue":
                    type = NUMBER;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    doubleValue = hsl.h;
                    return;
                case "lightness":
                    type = PERCENT;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    doubleValue = hsl.l * 100;
                    return;
                case "spin":
                    type = COLOR;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.h += getDouble( 1, formatter );
                    doubleValue = hsla( hsl );
                    return;
                case "lighten":
                    hsl = toHSL( getColor( 0, formatter ) );
                    if (parameters.size() > 2 && "relative".equals( get( 2 ).stringValue( formatter )) ) {
                        hsl.l += hsl.l * getPercent(1, formatter);
                    } else {
                        hsl.l += getPercent(1, formatter);
                    }
                    doubleValue = hsla( hsl );
                    return;
                case "darken":
                    hsl = toHSL( getColor( 0, formatter ) );
                    if (parameters.size() > 2 && "relative".equals( get( 2 ).stringValue( formatter )) ) {
                        hsl.l -= hsl.l * getPercent(1, formatter);
                    } else {
                        hsl.l -= getPercent(1, formatter);
                    }
                    doubleValue = hsla( hsl );
                    return;
                case "fadein":
                    type = RGBA;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.a += getPercent( 1, formatter );
                    doubleValue = hsla( hsl );
                    return;
                case "fadeout":
                    type = RGBA;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.a -= getPercent( 1, formatter );
                    doubleValue = hsla( hsl );
                    return;
                case "fade":
                    type = RGBA;
                    hsl = toHSL( getDouble( 0, formatter ) );
                    hsl.a = getPercent( 1, formatter );
                    doubleValue = hsla( hsl );
                    return;
                case "hsv":
                    type = COLOR;
                    doubleValue = hsva( getDouble( 0, formatter ), getPercent( 1, formatter ), getPercent( 2, formatter ), 1 );
                    return;
                case "hsva":
                    type = RGBA;
                    doubleValue = hsva( getDouble( 0, formatter ), getPercent( 1, formatter ), getPercent( 2, formatter ), getPercent( 3, formatter ) );
                    return;
                case "hsvhue":
                    doubleValue = toHSV( getColor( 0, formatter ) ).h;
                    type = NUMBER;
                    return;
                case "hsvsaturation":
                    doubleValue = toHSV( getColor( 0, formatter ) ).s * 100;
                    type = PERCENT;
                    return;
                case "hsvvalue":
                    doubleValue = toHSV( getColor( 0, formatter ) ).v * 100;
                    type = PERCENT;
                    return;
                case "contrast":
                    double color = getColor( 0, formatter );
                    double dark = getDouble( 1, BLACK, formatter );
                    double light = getDouble( 2, WHITE, formatter );
                    double threshold = getPercent( 3, 0.43, formatter );
                    doubleValue = contrast( color, dark, light, threshold );
                    return;
                case "luma":
                    color = getColor( 0, formatter );
                    type = PERCENT;
                    doubleValue = luma( color ) * 100;
                    return;
                case "luminance":
                    color = getColor( 0, formatter );
                    type = PERCENT;
                    doubleValue = luminance( color ) * 100;
                    return;
                case "multiply":
                    doubleValue = multiply( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "screen":
                    doubleValue = screen( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "overlay":
                    doubleValue = overlay( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "softlight":
                    doubleValue = softlight( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "hardlight":
                    doubleValue = hardlight( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "difference":
                    doubleValue = difference( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "exclusion":
                    doubleValue = exclusion( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "average":
                    doubleValue = average( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "negation":
                    doubleValue = negation( getColor( 0, formatter ), getColor( 1, formatter ) );
                    return;
                case "unit":
                    type = NUMBER;
                    doubleValue = getDouble( 0, formatter );
                    return;
                case "iscolor":
                    type = BOOLEAN;
                    int type0 = get( 0 ).getDataType( formatter );
                    booleanValue = type0 == COLOR || type0 == RGBA;
                    return;
                case "isnumber":
                    type = BOOLEAN;
                    type0 = get( 0 ).getDataType( formatter );
                    booleanValue = type0 == NUMBER || type0 == PERCENT;
                    return;
                case "isstring":
                    type = BOOLEAN;
                    booleanValue = get( 0 ).getDataType( formatter ) == STRING;
                    return;
                case "iskeyword":
                    type = BOOLEAN;
                    param = get( 0 );
                    if( param.getDataType( formatter ) == STRING ) {
                        str = param.stringValue( formatter );
                        booleanValue = str == UrlUtils.removeQuote( str );
                    } else {
                        booleanValue = false;
                    }
                    return;
                case "ispixel":
                    type = BOOLEAN;
                    param = get( 0 );
                    booleanValue = param.unit( formatter ).equals( "px" );
                    return;
                case "isem":
                    type = BOOLEAN;
                    param = get( 0 );
                    booleanValue = param.unit( formatter ).equals( "em" );
                    return;
                case "ispercentage":
                    type = BOOLEAN;
                    param = get( 0 );
                    booleanValue = param.unit( formatter ).equals( "%" );
                    return;
                case "isunit":
                    type = BOOLEAN;
                    unit = get( 1 ).stringValue( formatter );
                    param = get( 0 );
                    booleanValue = param.unit( formatter ).equals( unit );
                    return;
                case "if":
                    evalParam( get( 0 ).booleanValue( formatter ) ? 1 : 2, formatter );
                    return;
                case "default":
                    if( formatter.isGuard() ) {
                        type = BOOLEAN;
                        booleanValue = formatter.getGuardDefault();
                        return;
                    }
                    break;
                case "-":
                    type = get( 0 ).getDataType( formatter ) ;
                    doubleValue = -getDouble( 0, formatter );
                    return;
                case "%":
                case "escape":
                    type = STRING;
                    return;
            }
            if( super.toString().startsWith( "-" ) ) {
                type = STRING;
                return;
            }
        } catch( ParameterOutOfBoundsException ex ) {
            // ignore and continue as CSS function
        } catch (RuntimeException ex ) {
            throw createException( ex );
        }
        type = STRING;
        return;
    }
732501
private static boolean isSelector( StringBuilder builder ) {
        int length = builder.length();
        if( length == 0 ) {
            return false;
        }
        switch( builder.charAt( 0 ) ) { 
            case '.': // Mixin
            case '#': // Mixin
                break;
            default:
                return true;
        }
        for( int i = 1; i < length; i++ ) {
            char ch = builder.charAt( i );
            switch( ch ) {
                case '>':
                case ':':
                    return true;
            }
        }
        return false;
    }
470364
public <T extends AbstractJaxb> boolean hasCssClass(String clazz) {
        boolean result = false;
        List<String> classList = this.getCssClass();
        if (classList != null && classList.contains(clazz)) {
            result = true;
        }
        return result;
    }
1370583
Expression unpack( CssFormatter formatter ) {
        Expression unpack = this;
        do { // unpack packed expressions like parenthesis or variables
            if( unpack.getClass() == FunctionExpression.class && ((FunctionExpression)unpack).toString().isEmpty() ) { //Parenthesis
                unpack = ((FunctionExpression)unpack).get( 0 );
                continue;
            }
            if( unpack.getClass() == VariableExpression.class ) {
                unpack = ((VariableExpression)unpack).getValue( formatter );
                continue;
            }
            break;
        } while(true);
        return unpack;
    }
33390
function(strVal) {
      strVal = strVal.toLowerCase().trim();
      if (strVal) {
        if (this.isTransparent(strVal)) {
          this.value = {
            h: 0,
            s: 0,
            b: 0,
            a: 0
          };
          return true;
        } else {
          var parsedColor = this.parse(strVal);
          if (parsedColor) {
            this.value = this.value = {
              h: parsedColor.h,
              s: parsedColor.s,
              b: parsedColor.b,
              a: parsedColor.a
            };
            if (!this.origFormat) {
              this.origFormat = parsedColor.format;
            }
          } else if (this.fallbackValue) {
            // if parser fails, defaults to fallbackValue if defined, otherwise the value won't be changed
            this.value = this.fallbackValue;
          }
        }
      }
      return false;
    }
351445
void appendTo( @Nullable String[] mainSelector, CssFormatter formatter ) {
        try {
            String[] sel = selectors;

            for( int s = 0; s < sel.length; s++ ) {
                final String selector = sel[s];
                String str = SelectorUtils.replacePlaceHolder( formatter, selector, this );
                if( selector != str ) {
                    if( sel == selectors ) {
                        sel = sel.clone(); // we does not want change the declaration of this selectors
                    }
                    sel[s] = str;
                }
            }

            if( mainSelector == null ) {        // main ruls
                for( int i = 0; i < sel.length; i++ ) {
                    sel[i] = SelectorUtils.fastReplace( sel[i], "&", "" );
                }
            } else if( sel[0].charAt( 0 ) == '@' ) {
                // media
                bubbling( sel, mainSelector, formatter );
                return;
            } else {
                sel = SelectorUtils.merge( mainSelector, sel );
            }
            formatter.addMixin( this, null, variables );

            if( sel[0].startsWith( "@" ) ) {
                ruleset( sel, formatter );
            } else {
                if( properties.size() > 0 ) {
                    int size0 = formatter.getOutputSize();
                    CssFormatter block = formatter.startBlock( sel );
                    int size1 = block.getOutputSize();
                    appendPropertiesTo( block );
                    int size2 = block.getOutputSize();
                    block.endBlock();
                    if( block == formatter && size1 == size2 ) {
                        formatter.setOutputSize( size0 );
                    }
                }

                for( Formattable prop : properties ) {
                    if( prop instanceof Mixin ) {
                        ((Mixin)prop).appendSubRules( sel, formatter );
                    }
                }

                for( Rule rule : subrules ) {
                    if( rule.isValidCSS( formatter ) && !rule.isInlineRule( formatter) ) {
                        rule.appendTo( params != null ? mainSelector : sel, formatter );
                    }
                }
            }
            formatter.removeMixin();
        } catch( LessException ex ) {
            ex.addPosition( filename, line, column );
            throw ex;
        } catch( Exception ex ) {
            throw createException( ex );
        }
    }
148196
private boolean hasRuleSet(CssAtRule atRule, CssTokenIterator iter)
  {
    int debugIndex;
    if (debug)
    {
      checkArgument(iter.last.getChar() == '{');
      debugIndex = iter.index();
    }
    List<CssToken> list = iter.list;
    for (int i = iter.index() + 1; i < list.size(); i++)
    {
      CssToken tk = list.get(i);
      if (MATCH_OPENBRACE.apply(tk))
      {
        return true;
      }
      else if (MATCH_SEMI_CLOSEBRACE.apply(tk))
      {
        return false;
      }
    }
    if (debug)
    {
      checkState(iter.last.getChar() == '{');
      checkState(iter.index() == debugIndex);
    }
    return false;
  }
769088
function rule(analyzer) {
	analyzer.setMetric('notMinified');

	/**
	 * A simple CSS minification detector
	 */
	function isMinified(css) {
		// analyze the first 1024 characters
		css = css.trim().substring(0, 1024);

		// there should be no newline in minified file
		return /\n/.test(css) === false;
	}

	analyzer.on('css', function(css) {
		analyzer.setMetric('notMinified', isMinified(css) ? 0 : 1);
	});
}