Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

New Rule: no unused assigned values #48

Closed
Assignees
kibeha
Labels
enhancementNew feature or request
Milestone
@silviomarghitola

Description

@silviomarghitola

Language Usage / Variables & Types / General
Avoid assigning values to local variables that are not used by a subsequent statement

fromSonarQube

Dead stores should be removed

A dead store happens when a local variable is assigned a value that is not read by any subsequent instruction. Calculating or retrieving a value only to then overwrite it or throw it away, could indicate a serious error in the code. Even if it's not an error, it is at best a waste of resources. Therefore all calculated values should be used.

Noncompliant Code Example

declare  my_userVARCHAR2(30);  my_dateVARCHAR2(30);begin  my_user := user();  my_date :=sysdate();dbms_output.put_line('User:'|| my_user||', date:'|| my_user);end;

Compliant Solution

declare  my_userVARCHAR2(30);  my_dateVARCHAR2(30);begin  my_user := user();  my_date :=sysdate();dbms_output.put_line('User:'|| my_user||', date:'|| my_date);end;

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp