aws-samples / amazon-codeguru-reviewer-java-detectors
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 234 units with 1,545 lines of code in units (63.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (141 lines of code)
    • 30 small units (385 lines of code)
    • 199 very small units (1,019 lines of code)
0% | 0% | 9% | 24% | 65%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 0% | 9% | 24% | 65%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
detectors/amazon_sqs_enable_long_polling0% | 0% | 84% | 0% | 15%
detectors/code_clone0% | 0% | 43% | 42% | 13%
detectors/aws_batch_write_output_ignored0% | 0% | 55% | 27% | 17%
detectors/ldap_injection0% | 0% | 0% | 100% | 0%
detectors/mutually_exclusive_calls_found0% | 0% | 0% | 100% | 0%
detectors/aws_dynamodb_getitem_null_check0% | 0% | 0% | 100% | 0%
detectors/aws_parse_error_message0% | 0% | 0% | 100% | 0%
detectors/sync_metric_publish0% | 0% | 0% | 71% | 28%
detectors/s3_object_metadata_content_length_check0% | 0% | 0% | 100% | 0%
detectors/aws_custom_retries0% | 0% | 0% | 100% | 0%
detectors/infinite_loop0% | 0% | 0% | 100% | 0%
detectors/aws_iam_error_prone_policy0% | 0% | 0% | 69% | 30%
detectors/sql_injection0% | 0% | 0% | 56% | 43%
detectors/amazon_s3_transfer_manager_shutdown0% | 0% | 0% | 56% | 43%
detectors/amazon_s3_auto_paginated_with_prefix0% | 0% | 0% | 72% | 27%
detectors/missing_specifically_thrown_exception_handling0% | 0% | 0% | 50% | 50%
detectors/os_command_injection0% | 0% | 0% | 57% | 42%
detectors/not_recommended_apis0% | 0% | 0% | 66% | 33%
detectors/partial_encryption0% | 0% | 0% | 57% | 42%
detectors/batches_preferred_over_loops0% | 0% | 0% | 61% | 38%
detectors/aws_kms_reencryption0% | 0% | 0% | 61% | 38%
stubs0% | 0% | 0% | 0% | 100%
detectors/improper_locking0% | 0% | 0% | 0% | 100%
detectors/concurrency_deadlock0% | 0% | 0% | 0% | 100%
detectors/lambda_client_reuse0% | 0% | 0% | 0% | 100%
detectors/thread_safety_violation0% | 0% | 0% | 0% | 100%
detectors/thread_safety_class_violations0% | 0% | 0% | 0% | 100%
detectors/http_response_splitting0% | 0% | 0% | 0% | 100%
detectors/insecure_connection0% | 0% | 0% | 0% | 100%
detectors/kcl_with_call_process_records0% | 0% | 0% | 0% | 100%
detectors/out_of_sync_input_and_output0% | 0% | 0% | 0% | 100%
detectors/resource_leak0% | 0% | 0% | 0% | 100%
detectors/s3_verify_bucket_owner0% | 0% | 0% | 0% | 100%
detectors/concurrency_atomicity_violation0% | 0% | 0% | 0% | 100%
detectors/log_injection0% | 0% | 0% | 0% | 100%
detectors/xml_external_entity0% | 0% | 0% | 0% | 100%
detectors/dynamodb_transaction_library0% | 0% | 0% | 0% | 100%
detectors/throw_exception_with_trace0% | 0% | 0% | 0% | 100%
detectors/ldap_authentication0% | 0% | 0% | 0% | 100%
detectors/concurrency_over_synchronization0% | 0% | 0% | 0% | 100%
detectors/code_injection0% | 0% | 0% | 0% | 100%
detectors/xpath_injection0% | 0% | 0% | 0% | 100%
detectors/object_presence0% | 0% | 0% | 0% | 100%
detectors/avoid_reset_exception_rule0% | 0% | 0% | 0% | 100%
detectors/missing_file_deletion_result_check0% | 0% | 0% | 0% | 100%
detectors/finalize_on_super_class0% | 0% | 0% | 0% | 100%
detectors/untrusted_ami_images0% | 0% | 0% | 0% | 100%
detectors/reassign_synchronized_object0% | 0% | 0% | 0% | 100%
detectors/aws_inefficient_chain0% | 0% | 0% | 0% | 100%
detectors/sensitive_information_leak0% | 0% | 0% | 0% | 100%
detectors/amazon_sqs_change_message_visibility_check_status0% | 0% | 0% | 0% | 100%
detectors/aws_dynamodb_mapper_batch_output_ignored0% | 0% | 0% | 0% | 100%
detectors/null_check_cache_response_metadata0% | 0% | 0% | 0% | 100%
detectors/file_syntax_error0% | 0% | 0% | 0% | 100%
detectors/aws_service_client_initialization0% | 0% | 0% | 0% | 100%
detectors/lambda_override_reserved0% | 0% | 0% | 0% | 100%
detectors/incorrect_null_check_before_setting0% | 0% | 0% | 0% | 100%
detectors/missing_position_check_before_substring0% | 0% | 0% | 0% | 100%
detectors/aws_region_enumeration0% | 0% | 0% | 0% | 100%
detectors/path_traversal0% | 0% | 0% | 0% | 100%
detectors/hardcoded_credentials0% | 0% | 0% | 0% | 100%
detectors/clear_text_credentials0% | 0% | 0% | 0% | 100%
detectors/untrusted_deserialization0% | 0% | 0% | 0% | 100%
detectors/insecure_cryptography0% | 0% | 0% | 0% | 100%
detectors/insecure_temporary_file0% | 0% | 0% | 0% | 100%
detectors/string_equality_check0% | 0% | 0% | 0% | 100%
detectors/string_format_arguments0% | 0% | 0% | 0% | 100%
detectors/null_pointer_dereference0% | 0% | 0% | 0% | 100%
detectors/weak_random_number_generation0% | 0% | 0% | 0% | 100%
detectors/untrusted_data_in_decision0% | 0% | 0% | 0% | 100%
detectors/stream_anymatch_vs_findfirst0% | 0% | 0% | 0% | 100%
detectors/iterate_on_map_entries0% | 0% | 0% | 0% | 100%
detectors/insecure_cookie0% | 0% | 0% | 0% | 100%
detectors/mandatory_methods0% | 0% | 0% | 0% | 100%
detectors/stream_min_max_vs_sort0% | 0% | 0% | 0% | 100%
detectors/deprecated_method0% | 0% | 0% | 0% | 100%
detectors/simple_date_format_time_zone0% | 0% | 0% | 0% | 100%
detectors/amazon_sqs_name_url0% | 0% | 0% | 0% | 100%
detectors/loose_file_permissions0% | 0% | 0% | 0% | 100%
detectors/ui_thread_starvation0% | 0% | 0% | 0% | 100%
detectors/insecure_cors_policy0% | 0% | 0% | 0% | 100%
detectors/s3_object_user_metadata_key_case_sensitivity0% | 0% | 0% | 0% | 100%
detectors/session_fixation0% | 0% | 0% | 0% | 100%
detectors/json_parser_length0% | 0% | 0% | 0% | 100%
detectors/incorrect_authentication_exploitation0% | 0% | 0% | 0% | 100%
detectors/client_constructor_deprecated_rule0% | 0% | 0% | 0% | 100%
detectors/aws_bad_params0% | 0% | 0% | 0% | 100%
detectors/cross_site_request_forgery0% | 0% | 0% | 0% | 100%
detectors/weak_obfuscation_of_request0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static void createQueues()
in src/java/detectors/amazon_sqs_enable_long_polling/AmazonSqsEnableLongPollingCompliant.java
38 5 4
public static void createQueuesNoncompliant()
in src/java/detectors/amazon_sqs_enable_long_polling/AmazonSqsEnableLongPollingNoncompliant.java
37 5 4
private boolean doesVideoStreamExistForJobNoncompliant()
in src/java/detectors/code_clone/CodeCloneNoncompliant.java
22 6 4
private void updateVideoInfoInDynamoDBNoncompliant()
in src/java/detectors/code_clone/CodeCloneNoncompliant.java
22 7 4
public void flushCompliant()
in src/java/detectors/aws_batch_write_output_ignored/AwsBatchWriteOutputIgnored.java
22 5 3
public void iamPolicyNoncompliant()
in src/java/detectors/aws_iam_error_prone_policy/AwsIamErrorPronePolicy.java
18 1 2
public void ldapSearchCompliant()
in src/java/detectors/ldap_injection/LdapInjection.java
17 3 1
public void ec2RunInstancesNoncompliant()
in src/java/detectors/mutually_exclusive_calls_found/MutuallyExclusiveCallsFound.java
16 1 3
private boolean doesVideoStreamExistForJobCompliant()
in src/java/detectors/code_clone/CodeCloneCompliant.java
16 3 4
private void UpdateVideoInfoInDynamoDBCompliant()
in src/java/detectors/code_clone/CodeCloneCompliant.java
16 4 4
public void ec2RunInstancesCompliant()
in src/java/detectors/mutually_exclusive_calls_found/MutuallyExclusiveCallsFound.java
15 1 3
public void ldapSearchNoncompliant()
in src/java/detectors/ldap_injection/LdapInjection.java
14 2 1
public void dynamoDBGetItemCompliant()
in src/java/detectors/aws_dynamodb_getitem_null_check/AwsDynamodbGetitemNullCheck.java
14 3 2
public void executeSqlStatementCompliant()
in src/java/detectors/sql_injection/SqlInjection.java
13 3 2
public void branchingCompliant()
in src/java/detectors/aws_parse_error_message/AwsParseErrorMessage.java
13 3 0
public void s3GetObjectsNoncompliant()
in src/java/detectors/amazon_s3_auto_paginated_with_prefix/AmazonS3AutoPaginatedWithPrefix.java
13 3 2
public void transferManagerCompliant()
in src/java/detectors/amazon_s3_transfer_manager_shutdown/AmazonS3TransferManagerShutdown.java
13 2 1
public void dynamoDBGetItemNoncompliant()
in src/java/detectors/aws_dynamodb_getitem_null_check/AwsDynamodbGetitemNullCheck.java
12 2 2
public void branchingNoncompliant()
in src/java/detectors/aws_parse_error_message/AwsParseErrorMessage.java
12 3 0
public void s3PutOjectFromStreamCompliant()
in src/java/detectors/s3_object_metadata_content_length_check/S3ObjectMetadataContentLengthCheck.java
12 1 2