Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pavel-ignatovich
Copy link

Copy link

@monocodus monocodus bot left a 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) {
Copy link

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) {
Copy link

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 */
Copy link

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) {
Copy link

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) {
Copy link

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) {
Copy link

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 */
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ Files in C or C++ Demonstration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant