﻿# V1102\. Unreal Engine\. Violation of naming conventions may cause Unreal Header Tool to work incorrectly\.

The analyzer has detected a declaration that does not comply with Naming Conventions for Unreal Engine projects\. Compliance with the conventions is required for the correct operation of the Unreal Header Tool\.

**Note\.** The analyzer applies the diagnostic rule only to the analyzed files that include Unreal Engine header files\. If you want to enforce the rule on an arbitrary file, use the [mechanism](https://pvs-studio.com/en/docs/manual/0040/#treat_as_unreal_engine_file)\.

The following is a list of conventions supported by the diagnostic rule\.

Classes that inherit from 'UObject' are prefixed by 'U':

```cpp
class USomeClass : public UObject
{
  ....
};
```

Classes that inherit from 'AActor' are prefixed by 'A':

```cpp
class ASomeActor : public AActor
{
  ....
};
```

Classes that inherit from 'SWidget' are prefixed by 'S':

```cpp
class SSomeWidget : public SWidget
{
  ....
};
```

Classes that are abstract interfaces are prefixed by 'I':

```cpp
class IAbstractClass
{
public:
  virtual void DoSmth() = 0;
};
```

Enumerations are prefixed by 'E':

```cpp
enum class ESomeEnum
{
  ....
};
```

Template classes are prefixed by 'T':

```cpp
template <typename T>
class TClassTemplate
{
  ....
};
```

Other classes are prefixed by 'F':

```cpp
class FSimpleClass
{
  ....
};
```

Typedefs should be prefixed by whatever is appropriate for that type\. A typedef to a template instantiation should be prefixed as a particular entity:

```cpp
// usings
using UGameUIPolicy = USomeClass;
using AAIController = ASomeActor;  
using SActorCanvas  = SSomeWidget;  
using EColorBits    = ESomeEnum; 
using FArrowSlot    = FSimpleClass;

template <typename T>
using TMyArray = TClassTemplate<T>;

using FMyArrayFloat = TClassTemplate<float>;
using FMyArrayInt   = TMyArray<int>;

// typedefs
typedef USomeClass   UGameUIPolicy;
typedef ASomeActor   AAIController;
typedef SSomeWidget  SActorCanvas;
typedef ESomeEnum    EColorBits; 
typedef FSimpleClass FArrowSlot;

typedef TClassTemplate<int>   FMyArrayInt;
typedef TClassTemplate<float> FMyArrayFloat;
```

The analyzer issues a warning for each violation of the above\-listed conventions:

```cpp
class GameUIPolicy: public UObject { .... };

class BoxActor : public AActor { .... };

class WidgetButton : public SWidget { .... };

class Weapon
{
public:
  virtual void Shoot() = 0;
};

enum class Texture { .... };

class Enemy { .... };

template <typename T>
class DoubleLinkedList { .... };

typedef DoubleLinkedList<Enemy> EnemyList;
```

The fixed code:

```cpp
class UGameUIPolicy: public UObject { .... };

class ABoxActor : public AActor { .... };

class SWidgetButton : public SWidget { .... };

class IWeapon
{
public:
  virtual void Shoot() = 0;
};

enum class ETexture { .... };

class FEnemy { .... };

template <typename T>
class TDoubleLinkedList { .... };

typedef DoubleLinkedList<Enemy> FEnemyList;
```