• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 21108840797

18 Jan 2026 08:35AM UTC coverage: 60.508% (+0.02%) from 60.492%
21108840797

push

github

web-flow
ClangTidy readability-else-after-return (#857)

* trigger tidy

* Automated clang-tidy change: readability-else-after-return

* compile test

* rerun

* Automated clang-tidy change: readability-else-after-return

* trigger..

* Automated clang-tidy change: readability-else-after-return

* manually removed a few

* Automated clang-tidy change: readability-else-after-return

* removed duplicate code

* fix remaining warnings

* fixed scope

---------

Co-authored-by: Clang Tidy <clang-tidy@users.noreply.github.com>

837 of 1874 new or added lines in 151 files covered. (44.66%)

46 existing lines in 25 files now uncovered.

44448 of 73458 relevant lines covered (60.51%)

525066.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.11
/pol-core/bscript/compiler/ast/FunctionCall.cpp
1
#include "FunctionCall.h"
2

3

4
#include <map>
5
#include <utility>
6

7
#include "bscript/compiler/ast/Argument.h"
8
#include "bscript/compiler/ast/FunctionParameterDeclaration.h"
9
#include "bscript/compiler/ast/Identifier.h"
10
#include "bscript/compiler/ast/ModuleFunctionDeclaration.h"
11
#include "bscript/compiler/ast/NodeVisitor.h"
12
#include "bscript/compiler/file/SourceLocation.h"
13
#include "bscript/compiler/model/FunctionLink.h"
14

15
namespace Pol::Bscript::Compiler
16
{
17
FunctionCall::FunctionCall( const SourceLocation& source_location, std::string calling_scope,
18,874✔
18
                            ScopableName scoped_name,
19
                            std::vector<std::unique_ptr<Argument>> arguments )
18,874✔
20
    : Expression( source_location, std::move( arguments ) ),
18,874✔
21
      function_link( std::make_shared<FunctionLink>( source_location, calling_scope ) ),
18,874✔
22
      calling_scope( std::move( calling_scope ) ),
18,874✔
23
      scoped_name( std::make_unique<ScopableName>( std::move( scoped_name ) ) )
37,748✔
24
{
25
}
18,874✔
26

27
FunctionCall::FunctionCall( const SourceLocation& source_location, std::string calling_scope,
272✔
28
                            std::unique_ptr<Node> callee,
29
                            std::vector<std::unique_ptr<Argument>> arguments )
272✔
30
    : Expression( source_location, std::move( arguments ) ),
272✔
31
      function_link( std::make_shared<FunctionLink>( source_location, calling_scope ) ),
272✔
32
      calling_scope( std::move( calling_scope ) ),
272✔
33
      scoped_name( nullptr )  // FunctionCalls with expression-as-callees do not have a scoped name
544✔
34
{
35
  children.insert( children.begin(), std::move( callee ) );
272✔
36
}
272✔
37

38
void FunctionCall::accept( NodeVisitor& visitor )
111,739✔
39
{
40
  visitor.visit_function_call( *this );
111,739✔
41
}
111,739✔
42

43
void FunctionCall::describe_to( std::string& w ) const
285✔
44
{
45
  if ( scoped_name )
285✔
46
  {
47
    fmt::format_to( std::back_inserter( w ), "function-call({})", scoped_name->string() );
566✔
48
  }
49
  else
50
  {
51
    fmt::format_to( std::back_inserter( w ), "expression-as-callee function-call" );
4✔
52
  }
53
}
285✔
54

55
std::vector<std::unique_ptr<Argument>> FunctionCall::take_arguments()
18,428✔
56
{
57
  std::vector<std::unique_ptr<Argument>> args;
18,428✔
58
  args.reserve( children.size() );
18,428✔
59
  for ( auto& child : children )
41,926✔
60
  {
61
    args.emplace_back( static_unique_pointer_cast<Argument, Node>( std::move( child ) ) );
23,498✔
62
  }
63
  return args;
18,428✔
64
}
×
65

66
std::vector<std::reference_wrapper<FunctionParameterDeclaration>> FunctionCall::parameters() const
18,428✔
67
{
68
  if ( auto fn = function_link->function() )
18,428✔
69
    return fn->parameters();
18,428✔
NEW
70
  internal_error( "function has not been resolved" );
×
71
}
72

73
std::string FunctionCall::string() const
18,628✔
74
{
75
  // Should only be used on compile-time function calls (ie. not an
76
  // expression-as-callee function call) that actually have a ScopedName.
77
  if ( scoped_name )
18,628✔
78
    return scoped_name->string();
18,628✔
79
  return "";
×
80
}
81
}  // namespace Pol::Bscript::Compiler
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc