mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
31 lines
671 B
C#
31 lines
671 B
C#
using System;
|
|
|
|
class IdAttribute : Attribute
|
|
{
|
|
public IdAttribute(int x = 0) { }
|
|
|
|
public int id;
|
|
}
|
|
|
|
class IntAttributes
|
|
{
|
|
// GOOD: Constants in attributes shouldn't be flagged, and shouldn't contribute to the count.
|
|
[Id(id = 555)]
|
|
void f1()
|
|
{
|
|
}
|
|
|
|
// GOOD: Constants in attributes shouldn't be flagged, and shouldn't contribute to the count.
|
|
[Id(555 + 555)]
|
|
void f2()
|
|
{
|
|
// BAD
|
|
var x = 555 +
|
|
555 + 555 + 555 + 555 + 555 + 555 + 555 + 555 + 555 + 555 +
|
|
555 + 555 + 555 + 555 + 555 + 555 + 555 + 555 + 555 + 555;
|
|
}
|
|
|
|
}
|
|
|
|
// semmle-extractor-options: /r:System.ComponentModel.Primitives.dll
|