Skip to content

Commit 786c0a4

Browse files
authored
Merge pull request #286 from wravery/sonar-qube
Fixing SonarQube static analysis warnings
2 parents ed0a754 + a2d711b commit 786c0a4

File tree

156 files changed

+1724
-1176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1724
-1176
lines changed

include/SchemaLoader.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
namespace graphql::generator {
2121

2222
// These are the set of built-in types in GraphQL.
23-
enum class [[nodiscard]] BuiltinType {
23+
enum class [[nodiscard]] BuiltinType
24+
{
2425
Int,
2526
Float,
2627
String,
@@ -75,7 +76,8 @@ using EnumTypeList = std::vector<EnumType>;
7576
// Input types are complex types that have a set of named fields. Each field may be
7677
// a scalar type (including lists or non-null wrappers) or another nested input type,
7778
// but it cannot include output object types.
78-
enum class [[nodiscard]] InputFieldType {
79+
enum class [[nodiscard]] InputFieldType
80+
{
7981
Builtin,
8082
Scalar,
8183
Enum,
@@ -136,7 +138,8 @@ using UnionTypeList = std::vector<UnionType>;
136138
// field may be a scalar type (including lists or non-null wrappers) or another nested
137139
// output type, but it cannot include input object types. Each field can also take
138140
// optional arguments which are all input types.
139-
enum class [[nodiscard]] OutputFieldType {
141+
enum class [[nodiscard]] OutputFieldType
142+
{
140143
Builtin,
141144
Scalar,
142145
Enum,
@@ -264,6 +267,8 @@ class [[nodiscard]] SchemaLoader
264267
[[nodiscard]] static std::string getOutputCppAccessor(const OutputField& field) noexcept;
265268
[[nodiscard]] static std::string getOutputCppResolver(const OutputField& field) noexcept;
266269

270+
[[nodiscard]] static bool shouldMoveInputField(const InputField& field) noexcept;
271+
267272
private:
268273
[[nodiscard]] static bool isExtension(const peg::ast_node& definition) noexcept;
269274

include/graphqlservice/GraphQLResponse.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ namespace graphql::response {
3333
// GraphQL responses are not technically JSON-specific, although that is probably the most common
3434
// way of representing them. These are the primitive types that may be represented in GraphQL, as
3535
// of the [October 2021 spec](https://spec.graphql.org/October2021/#sec-Serialization-Format).
36-
enum class [[nodiscard]] Type : std::uint8_t {
36+
enum class [[nodiscard]] Type : std::uint8_t
37+
{
3738
Map, // JSON Object
3839
List, // JSON Array
3940
String, // JSON String
@@ -392,7 +393,7 @@ class [[nodiscard]] Writer final
392393
template <class T>
393394
struct Model : Concept
394395
{
395-
Model(std::unique_ptr<T>&& pimpl)
396+
explicit Model(std::unique_ptr<T> pimpl) noexcept
396397
: _pimpl { std::move(pimpl) }
397398
{
398399
}
@@ -455,7 +456,7 @@ class [[nodiscard]] Writer final
455456

456457
public:
457458
template <class T>
458-
Writer(std::unique_ptr<T> writer)
459+
Writer(std::unique_ptr<T> writer) noexcept
459460
: _concept { std::static_pointer_cast<const Concept>(
460461
std::make_shared<Model<T>>(std::move(writer))) }
461462
{

0 commit comments

Comments
 (0)