big-code-analysis 1.1.0

Tool to compute and export code metrics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
// See `src/languages/mod.rs` for the rationale behind the per-file
// pedantic carve-outs below.
#![allow(clippy::match_same_arms, clippy::too_many_lines)]

// Code generated; DO NOT EDIT.

use num_derive::FromPrimitive;

#[derive(Clone, Debug, PartialEq, Eq, FromPrimitive)]
pub enum Go {
    End = 0,
    Identifier = 1,
    SourceFileToken1 = 2,
    SEMI = 3,
    Anon4 = 4,
    Package = 5,
    Import = 6,
    DOT = 7,
    BlankIdentifier = 8,
    LPAREN = 9,
    RPAREN = 10,
    Const = 11,
    COMMA = 12,
    EQ = 13,
    Var = 14,
    Func = 15,
    LBRACK = 16,
    RBRACK = 17,
    DOTDOTDOT = 18,
    Type = 19,
    STAR = 20,
    Struct = 21,
    TILDE = 22,
    LBRACE = 23,
    RBRACE = 24,
    Interface = 25,
    PIPE = 26,
    Map = 27,
    Chan = 28,
    LTDASH = 29,
    COLONEQ = 30,
    PLUSPLUS = 31,
    DASHDASH = 32,
    STAREQ = 33,
    SLASHEQ = 34,
    PERCENTEQ = 35,
    LTLTEQ = 36,
    GTGTEQ = 37,
    AMPEQ = 38,
    AMPCARETEQ = 39,
    PLUSEQ = 40,
    DASHEQ = 41,
    PIPEEQ = 42,
    CARETEQ = 43,
    COLON = 44,
    Fallthrough = 45,
    Break = 46,
    Continue = 47,
    Goto = 48,
    Return = 49,
    Go = 50,
    Defer = 51,
    If = 52,
    Else = 53,
    For = 54,
    Range = 55,
    Switch = 56,
    Case = 57,
    Default = 58,
    Select = 59,
    Identifier2 = 60,
    Identifier3 = 61,
    PLUS = 62,
    DASH = 63,
    BANG = 64,
    CARET = 65,
    AMP = 66,
    SLASH = 67,
    PERCENT = 68,
    LTLT = 69,
    GTGT = 70,
    AMPCARET = 71,
    EQEQ = 72,
    BANGEQ = 73,
    LT = 74,
    LTEQ = 75,
    GT = 76,
    GTEQ = 77,
    AMPAMP = 78,
    PIPEPIPE = 79,
    BQUOTE = 80,
    RawStringLiteralContent = 81,
    DQUOTE = 82,
    InterpretedStringLiteralContent = 83,
    DQUOTE2 = 84,
    EscapeSequence = 85,
    IntLiteral = 86,
    FloatLiteral = 87,
    ImaginaryLiteral = 88,
    RuneLiteral = 89,
    Nil = 90,
    True = 91,
    False = 92,
    Iota = 93,
    Comment = 94,
    SourceFile = 95,
    PackageClause = 96,
    ImportDeclaration = 97,
    ImportSpec = 98,
    Dot = 99,
    ImportSpecList = 100,
    Declaration = 101,
    ConstDeclaration = 102,
    ConstSpec = 103,
    VarDeclaration = 104,
    VarSpec = 105,
    VarSpecList = 106,
    FunctionDeclaration = 107,
    MethodDeclaration = 108,
    TypeParameterList = 109,
    TypeParameterDeclaration = 110,
    ParameterList = 111,
    ParameterDeclaration = 112,
    VariadicParameterDeclaration = 113,
    TypeAlias = 114,
    TypeDeclaration = 115,
    TypeSpec = 116,
    ExpressionList = 117,
    ParenthesizedType = 118,
    SimpleType = 119,
    GenericType = 120,
    TypeArguments = 121,
    PointerType = 122,
    ArrayType = 123,
    ImplicitLengthArrayType = 124,
    SliceType = 125,
    StructType = 126,
    NegatedType = 127,
    FieldDeclarationList = 128,
    FieldDeclaration = 129,
    InterfaceType = 130,
    MethodElem = 131,
    TypeElem = 132,
    MapType = 133,
    ChannelType = 134,
    FunctionType = 135,
    Block = 136,
    StatementList = 137,
    Statement = 138,
    EmptyStatement = 139,
    SimpleStatement = 140,
    ExpressionStatement = 141,
    SendStatement = 142,
    ReceiveStatement = 143,
    IncStatement = 144,
    DecStatement = 145,
    AssignmentStatement = 146,
    ShortVarDeclaration = 147,
    LabeledStatement = 148,
    LabeledStatement2 = 149,
    FallthroughStatement = 150,
    BreakStatement = 151,
    ContinueStatement = 152,
    GotoStatement = 153,
    ReturnStatement = 154,
    GoStatement = 155,
    DeferStatement = 156,
    IfStatement = 157,
    ForStatement = 158,
    ForClause = 159,
    RangeClause = 160,
    ExpressionSwitchStatement = 161,
    ExpressionCase = 162,
    DefaultCase = 163,
    TypeSwitchStatement = 164,
    TypeSwitchHeader = 165,
    TypeCase = 166,
    SelectStatement = 167,
    CommunicationCase = 168,
    Expression = 169,
    ParenthesizedExpression = 170,
    CallExpression = 171,
    VariadicArgument = 172,
    ArgumentList = 173,
    ArgumentList2 = 174,
    SelectorExpression = 175,
    IndexExpression = 176,
    SliceExpression = 177,
    TypeAssertionExpression = 178,
    TypeConversionExpression = 179,
    TypeInstantiationExpression = 180,
    CompositeLiteral = 181,
    LiteralValue = 182,
    LiteralElement = 183,
    KeyedElement = 184,
    FuncLiteral = 185,
    UnaryExpression = 186,
    BinaryExpression = 187,
    QualifiedType = 188,
    RawStringLiteral = 189,
    InterpretedStringLiteral = 190,
    SourceFileRepeat1 = 191,
    ImportSpecListRepeat1 = 192,
    ConstDeclarationRepeat1 = 193,
    ConstSpecRepeat1 = 194,
    VarSpecRepeat1 = 195,
    VarSpecListRepeat1 = 196,
    TypeParameterListRepeat1 = 197,
    ParameterListRepeat1 = 198,
    TypeDeclarationRepeat1 = 199,
    ExpressionListRepeat1 = 200,
    TypeArgumentsRepeat1 = 201,
    FieldDeclarationListRepeat1 = 202,
    FieldDeclarationRepeat1 = 203,
    InterfaceTypeRepeat1 = 204,
    TypeElemRepeat1 = 205,
    StatementListRepeat1 = 206,
    ExpressionSwitchStatementRepeat1 = 207,
    TypeSwitchStatementRepeat1 = 208,
    TypeCaseRepeat1 = 209,
    SelectStatementRepeat1 = 210,
    ArgumentListRepeat1 = 211,
    LiteralValueRepeat1 = 212,
    InterpretedStringLiteralRepeat1 = 213,
    FieldIdentifier = 214,
    LabelName = 215,
    PackageIdentifier = 216,
    TypeConstraint = 217,
    TypeIdentifier = 218,
    Error = 219,
}

impl From<Go> for &'static str {
    #[inline]
    fn from(tok: Go) -> Self {
        match tok {
            Go::End => "end",
            Go::Identifier => "identifier",
            Go::SourceFileToken1 => "source_file_token1",
            Go::SEMI => ";",
            Go::Anon4 => "",
            Go::Package => "package",
            Go::Import => "import",
            Go::DOT => ".",
            Go::BlankIdentifier => "blank_identifier",
            Go::LPAREN => "(",
            Go::RPAREN => ")",
            Go::Const => "const",
            Go::COMMA => ",",
            Go::EQ => "=",
            Go::Var => "var",
            Go::Func => "func",
            Go::LBRACK => "[",
            Go::RBRACK => "]",
            Go::DOTDOTDOT => "...",
            Go::Type => "type",
            Go::STAR => "*",
            Go::Struct => "struct",
            Go::TILDE => "~",
            Go::LBRACE => "{",
            Go::RBRACE => "}",
            Go::Interface => "interface",
            Go::PIPE => "|",
            Go::Map => "map",
            Go::Chan => "chan",
            Go::LTDASH => "<-",
            Go::COLONEQ => ":=",
            Go::PLUSPLUS => "++",
            Go::DASHDASH => "--",
            Go::STAREQ => "*=",
            Go::SLASHEQ => "/=",
            Go::PERCENTEQ => "%=",
            Go::LTLTEQ => "<<=",
            Go::GTGTEQ => ">>=",
            Go::AMPEQ => "&=",
            Go::AMPCARETEQ => "&^=",
            Go::PLUSEQ => "+=",
            Go::DASHEQ => "-=",
            Go::PIPEEQ => "|=",
            Go::CARETEQ => "^=",
            Go::COLON => ":",
            Go::Fallthrough => "fallthrough",
            Go::Break => "break",
            Go::Continue => "continue",
            Go::Goto => "goto",
            Go::Return => "return",
            Go::Go => "go",
            Go::Defer => "defer",
            Go::If => "if",
            Go::Else => "else",
            Go::For => "for",
            Go::Range => "range",
            Go::Switch => "switch",
            Go::Case => "case",
            Go::Default => "default",
            Go::Select => "select",
            Go::Identifier2 => "identifier",
            Go::Identifier3 => "identifier",
            Go::PLUS => "+",
            Go::DASH => "-",
            Go::BANG => "!",
            Go::CARET => "^",
            Go::AMP => "&",
            Go::SLASH => "/",
            Go::PERCENT => "%",
            Go::LTLT => "<<",
            Go::GTGT => ">>",
            Go::AMPCARET => "&^",
            Go::EQEQ => "==",
            Go::BANGEQ => "!=",
            Go::LT => "<",
            Go::LTEQ => "<=",
            Go::GT => ">",
            Go::GTEQ => ">=",
            Go::AMPAMP => "&&",
            Go::PIPEPIPE => "||",
            Go::BQUOTE => "`",
            Go::RawStringLiteralContent => "raw_string_literal_content",
            Go::DQUOTE => "\"",
            Go::InterpretedStringLiteralContent => "interpreted_string_literal_content",
            Go::DQUOTE2 => "\"",
            Go::EscapeSequence => "escape_sequence",
            Go::IntLiteral => "int_literal",
            Go::FloatLiteral => "float_literal",
            Go::ImaginaryLiteral => "imaginary_literal",
            Go::RuneLiteral => "rune_literal",
            Go::Nil => "nil",
            Go::True => "true",
            Go::False => "false",
            Go::Iota => "iota",
            Go::Comment => "comment",
            Go::SourceFile => "source_file",
            Go::PackageClause => "package_clause",
            Go::ImportDeclaration => "import_declaration",
            Go::ImportSpec => "import_spec",
            Go::Dot => "dot",
            Go::ImportSpecList => "import_spec_list",
            Go::Declaration => "_declaration",
            Go::ConstDeclaration => "const_declaration",
            Go::ConstSpec => "const_spec",
            Go::VarDeclaration => "var_declaration",
            Go::VarSpec => "var_spec",
            Go::VarSpecList => "var_spec_list",
            Go::FunctionDeclaration => "function_declaration",
            Go::MethodDeclaration => "method_declaration",
            Go::TypeParameterList => "type_parameter_list",
            Go::TypeParameterDeclaration => "type_parameter_declaration",
            Go::ParameterList => "parameter_list",
            Go::ParameterDeclaration => "parameter_declaration",
            Go::VariadicParameterDeclaration => "variadic_parameter_declaration",
            Go::TypeAlias => "type_alias",
            Go::TypeDeclaration => "type_declaration",
            Go::TypeSpec => "type_spec",
            Go::ExpressionList => "expression_list",
            Go::ParenthesizedType => "parenthesized_type",
            Go::SimpleType => "_simple_type",
            Go::GenericType => "generic_type",
            Go::TypeArguments => "type_arguments",
            Go::PointerType => "pointer_type",
            Go::ArrayType => "array_type",
            Go::ImplicitLengthArrayType => "implicit_length_array_type",
            Go::SliceType => "slice_type",
            Go::StructType => "struct_type",
            Go::NegatedType => "negated_type",
            Go::FieldDeclarationList => "field_declaration_list",
            Go::FieldDeclaration => "field_declaration",
            Go::InterfaceType => "interface_type",
            Go::MethodElem => "method_elem",
            Go::TypeElem => "type_elem",
            Go::MapType => "map_type",
            Go::ChannelType => "channel_type",
            Go::FunctionType => "function_type",
            Go::Block => "block",
            Go::StatementList => "statement_list",
            Go::Statement => "_statement",
            Go::EmptyStatement => "empty_statement",
            Go::SimpleStatement => "_simple_statement",
            Go::ExpressionStatement => "expression_statement",
            Go::SendStatement => "send_statement",
            Go::ReceiveStatement => "receive_statement",
            Go::IncStatement => "inc_statement",
            Go::DecStatement => "dec_statement",
            Go::AssignmentStatement => "assignment_statement",
            Go::ShortVarDeclaration => "short_var_declaration",
            Go::LabeledStatement => "labeled_statement",
            Go::LabeledStatement2 => "labeled_statement",
            Go::FallthroughStatement => "fallthrough_statement",
            Go::BreakStatement => "break_statement",
            Go::ContinueStatement => "continue_statement",
            Go::GotoStatement => "goto_statement",
            Go::ReturnStatement => "return_statement",
            Go::GoStatement => "go_statement",
            Go::DeferStatement => "defer_statement",
            Go::IfStatement => "if_statement",
            Go::ForStatement => "for_statement",
            Go::ForClause => "for_clause",
            Go::RangeClause => "range_clause",
            Go::ExpressionSwitchStatement => "expression_switch_statement",
            Go::ExpressionCase => "expression_case",
            Go::DefaultCase => "default_case",
            Go::TypeSwitchStatement => "type_switch_statement",
            Go::TypeSwitchHeader => "_type_switch_header",
            Go::TypeCase => "type_case",
            Go::SelectStatement => "select_statement",
            Go::CommunicationCase => "communication_case",
            Go::Expression => "_expression",
            Go::ParenthesizedExpression => "parenthesized_expression",
            Go::CallExpression => "call_expression",
            Go::VariadicArgument => "variadic_argument",
            Go::ArgumentList => "argument_list",
            Go::ArgumentList2 => "argument_list",
            Go::SelectorExpression => "selector_expression",
            Go::IndexExpression => "index_expression",
            Go::SliceExpression => "slice_expression",
            Go::TypeAssertionExpression => "type_assertion_expression",
            Go::TypeConversionExpression => "type_conversion_expression",
            Go::TypeInstantiationExpression => "type_instantiation_expression",
            Go::CompositeLiteral => "composite_literal",
            Go::LiteralValue => "literal_value",
            Go::LiteralElement => "literal_element",
            Go::KeyedElement => "keyed_element",
            Go::FuncLiteral => "func_literal",
            Go::UnaryExpression => "unary_expression",
            Go::BinaryExpression => "binary_expression",
            Go::QualifiedType => "qualified_type",
            Go::RawStringLiteral => "raw_string_literal",
            Go::InterpretedStringLiteral => "interpreted_string_literal",
            Go::SourceFileRepeat1 => "source_file_repeat1",
            Go::ImportSpecListRepeat1 => "import_spec_list_repeat1",
            Go::ConstDeclarationRepeat1 => "const_declaration_repeat1",
            Go::ConstSpecRepeat1 => "const_spec_repeat1",
            Go::VarSpecRepeat1 => "var_spec_repeat1",
            Go::VarSpecListRepeat1 => "var_spec_list_repeat1",
            Go::TypeParameterListRepeat1 => "type_parameter_list_repeat1",
            Go::ParameterListRepeat1 => "parameter_list_repeat1",
            Go::TypeDeclarationRepeat1 => "type_declaration_repeat1",
            Go::ExpressionListRepeat1 => "expression_list_repeat1",
            Go::TypeArgumentsRepeat1 => "type_arguments_repeat1",
            Go::FieldDeclarationListRepeat1 => "field_declaration_list_repeat1",
            Go::FieldDeclarationRepeat1 => "field_declaration_repeat1",
            Go::InterfaceTypeRepeat1 => "interface_type_repeat1",
            Go::TypeElemRepeat1 => "type_elem_repeat1",
            Go::StatementListRepeat1 => "statement_list_repeat1",
            Go::ExpressionSwitchStatementRepeat1 => "expression_switch_statement_repeat1",
            Go::TypeSwitchStatementRepeat1 => "type_switch_statement_repeat1",
            Go::TypeCaseRepeat1 => "type_case_repeat1",
            Go::SelectStatementRepeat1 => "select_statement_repeat1",
            Go::ArgumentListRepeat1 => "argument_list_repeat1",
            Go::LiteralValueRepeat1 => "literal_value_repeat1",
            Go::InterpretedStringLiteralRepeat1 => "interpreted_string_literal_repeat1",
            Go::FieldIdentifier => "field_identifier",
            Go::LabelName => "label_name",
            Go::PackageIdentifier => "package_identifier",
            Go::TypeConstraint => "type_constraint",
            Go::TypeIdentifier => "type_identifier",
            Go::Error => "ERROR",
        }
    }
}

impl From<u16> for Go {
    #[inline]
    fn from(x: u16) -> Self {
        num::FromPrimitive::from_u16(x).unwrap_or(Self::Error)
    }
}

// Go == u16
impl PartialEq<u16> for Go {
    #[inline]
    fn eq(&self, x: &u16) -> bool {
        *self == Into::<Self>::into(*x)
    }
}

// u16 == Go
impl PartialEq<Go> for u16 {
    #[inline]
    fn eq(&self, x: &Go) -> bool {
        *x == *self
    }
}