-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bcon.c from C Driver for MongoDB #14
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is autogenerated code-style review, new suggestions: 7
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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