bcon.c from C Driver for MongoDB#14
Conversation
| return Token_Default; | ||
| } | ||
|
|
||
| static bcon_error_t bson_bcon_key_value(bson *b, const char *key, const char *typespec, const bcon bci) { |
There was a problem hiding this comment.
The function is too long
bson_bcon_key_value( bson * b , const char * key , const char * typespec , const bcon bci) now spans 88 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.
This comment was generated with the following checker: long_method
| /* | ||
| * simplified FSM to parse BCON structure, uses stacks for sub-documents and sub-arrays | ||
| */ | ||
| static bcon_error_t bson_append_bcon_with_state(bson *b, const bcon *bc, bcon_state_t start_state) { |
There was a problem hiding this comment.
The function is too long
bson_append_bcon_with_state( bson * b , const bcon * bc , bcon_state_t start_state) now spans 103 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.
This comment was generated with the following checker: long_method
| return ( ret == BSON_OK ? BCON_OK : BCON_BSON_ERROR ); | ||
| } | ||
|
|
||
| void bcon_print(const bcon *bc) { /* prints internal representation, not JSON */ |
There was a problem hiding this comment.
The function is too long
bcon_print( const bcon * bc) now spans 79 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.
This comment was generated with the following checker: long_method
| /* should be static, but it used by test files */ | ||
| bcon_token_t bcon_token(char *s); | ||
|
|
||
| bcon_token_t bcon_token(char *s) { |
There was a problem hiding this comment.
The function is too complicated
bcon_token( char * s) now has cyclomatic complexity of 21.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.
This comment was generated with the following checker: high_cyclomatic_complexity
| return Token_Default; | ||
| } | ||
|
|
||
| static bcon_error_t bson_bcon_key_value(bson *b, const char *key, const char *typespec, const bcon bci) { |
There was a problem hiding this comment.
The function is too complicated
bson_bcon_key_value( bson * b , const char * key , const char * typespec , const bcon bci) now has cyclomatic complexity of 43.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.
This comment was generated with the following checker: high_cyclomatic_complexity
| /* | ||
| * simplified FSM to parse BCON structure, uses stacks for sub-documents and sub-arrays | ||
| */ | ||
| static bcon_error_t bson_append_bcon_with_state(bson *b, const bcon *bc, bcon_state_t start_state) { |
There was a problem hiding this comment.
The function is too complicated
bson_append_bcon_with_state( bson * b , const bcon * bc , bcon_state_t start_state) now has cyclomatic complexity of 20.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.
This comment was generated with the following checker: high_cyclomatic_complexity
| return ( ret == BSON_OK ? BCON_OK : BCON_BSON_ERROR ); | ||
| } | ||
|
|
||
| void bcon_print(const bcon *bc) { /* prints internal representation, not JSON */ |
There was a problem hiding this comment.
The function is too complicated
bcon_print( const bcon * bc) now has cyclomatic complexity of 66.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.
This comment was generated with the following checker: high_cyclomatic_complexity
src/bcon.c from https://github.com/10gen-archive/mongo-c-driver-legacy/blob/9335eaa/src/bcon.c