SonarSource Rules
  • Products

    In-IDE

    Code Quality and Security in your IDE with SonarQube Ide

    IDE extension that lets you fix coding issues before they exist!

    Discover SonarQube for IDE

    SaaS

    Code Quality and Security in the cloud with SonarQube Cloud

    Setup is effortless and analysis is automatic for most languages

    Discover SonarQube Cloud

    Self-Hosted

    Code Quality and Security Self-Hosted with SonarQube Server

    Fast, accurate analysis; enterprise scalability

    Discover SonarQube Server
  • SecretsSecrets
  • ABAPABAP
  • AnsibleAnsible
  • ApexApex
  • AzureResourceManagerAzureResourceManager
  • CC
  • C#C#
  • C++C++
  • CloudFormationCloudFormation
  • COBOLCOBOL
  • CSSCSS
  • DartDart
  • DockerDocker
  • FlexFlex
  • GitHub ActionsGitHub Actions
  • GoGo
  • HTMLHTML
  • JavaJava
  • JavaScriptJavaScript
  • JSONJSON
  • JCLJCL
  • KotlinKotlin
  • KubernetesKubernetes
  • Objective CObjective C
  • PHPPHP
  • PL/IPL/I
  • PL/SQLPL/SQL
  • PythonPython
  • RPGRPG
  • RubyRuby
  • RustRust
  • ScalaScala
  • ShellShell
  • SwiftSwift
  • TerraformTerraform
  • TextText
  • TypeScriptTypeScript
  • T-SQLT-SQL
  • VB.NETVB.NET
  • VB6VB6
  • XMLXML
  • YAMLYAML
C

C static code analysis

Unique rules to find Bugs, Vulnerabilities, Security Hotspots, and Code Smells in your C code

  • All rules 420
  • Vulnerability14
  • Bug111
  • Security Hotspot19
  • Code Smell276

  • Quick Fix 27
Filtered: 5 rules found
full-project
    Impact
      Clean code attribute
        1. Functions that are not used in a project should be removed

           Code Smell
        2. Server hostnames should be verified during SSL/TLS connections

           Vulnerability
        3. Server certificates should be verified during SSL/TLS connections

           Vulnerability
        4. The parameters in all "declarations" or overrides of a function shall either be unnamed or have identical names

           Code Smell
        5. All "declarations" of a variable or function shall have the same type

           Bug

        The parameters in all "declarations" or overrides of a function shall either be unnamed or have identical names

        intentionality - clear
        maintainability
        Code Smell
        • confusing
        • full-project
        • misra-c++2023
        • misra-required

        Why is this an issue?

        This rule is part of MISRA C++:2023.

        Usage of this content is governed by Sonar’s terms and conditions. Redistribution is prohibited.

        Rule 13.3.3 - The parameters in all declarations [1] or overrides of a function shall either be unnamed or have identical names

        Category: Required

        Analysis: Decidable,System

        Rationale

        The name given to a parameter helps document the purpose of the parameter. If a function parameter is renamed in a subsequent declaration [1], then having different names for the same object may lead to developer confusion.

        Example

        The following example is compliant:

        void fn1( int32_t a );
        void fn1( int32_t   );
        

        The following example is non-compliant as the parameter names have been swapped:

        void CreateRectangle( uint32_t Height, uint32_t Width  );
        void CreateRectangle( uint32_t Width,  uint32_t Height );
        

        The following example is non-compliant as the named parameters are different:

        void fn2( int32_t a );
        void fn2( int32_t b ) { }
        

        The following example is non-compliant as the parameter name in the override differs from the parameter name in the overridden function:

        class Shape
        {
          virtual void draw( Canvas & destination ) = 0;
        };
        
        class Rectangle : public Shape
        {
          void draw( Canvas & canvas ) override;
        };
        

        The rule does not apply to the following example as the specialization is a different declaration [1] (note that this example is non-compliant with M23_184: MISRA C++ 2023 Rule 17.8.1):

        template< class T > void f( T t );
        template<> void f< int32_t >( int32_t i );
        

        Glossary

        [1] Declaration

        A declaration introduces the name of an entity into a translation unit (see [basic.def]/1).

        An entity may be declared several times. The first declaration of an entity in a translation unit is called an introduction [2]. All subsequent declarations are called redeclarations [3].

        A definition [4] is a declaration, as described in [basic.def]/2.

        [2] Introduction

        See declaration [1].

        [3] Redeclaration

        See declaration [1].

        [4] Definition

        See declaration [1].

        Copyright The MISRA Consortium Limited © 2023

          Available In:
        • SonarQube IdeCatch issues on the fly,
          in your IDE
        • SonarQube CloudDetect issues in your GitHub, Azure DevOps Services, Bitbucket Cloud, GitLab repositories
        • SonarQube ServerAnalyze code in your
          on-premise CI

        © 2025 SonarSource Sàrl. All rights reserved.

        Privacy Policy | Cookie Policy | Terms of Use