uruba/FinanCalc

View on GitHub
src/Calculators/BondFairValueCalculator.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method getBondFairValue has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function getBondFairValue()
        {
            // we need to get the coupon rate per payment period = c/payment frequency
            $couponRateForPeriod = MathFuncs::div(
                $this->bondAnnualCouponRate,
Severity: Minor
Found in src/Calculators/BondFairValueCalculator.php - About 1 hr to fix

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

                $bondFaceValue,
                $bondAnnualCouponRate,
                $bondVIR,
                $bondYearsToMaturity,
                $bondPaymentFrequency = 1
    Severity: Minor
    Found in src/Calculators/BondFairValueCalculator.php - About 35 mins to fix

      Line exceeds 120 characters; contains 123 characters
      Open

                  // now we can use the formula to calculate the real value of the bond (i.e., the present value of its payments)

      The variable $PVofUnitBondAnnuity is not named in camelCase.
      Open

              public function getBondFairValue()
              {
                  // we need to get the coupon rate per payment period = c/payment frequency
                  $couponRateForPeriod = MathFuncs::div(
                      $this->bondAnnualCouponRate,

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $VIRForPeriod is not named in camelCase.
      Open

              public function getBondFairValue()
              {
                  // we need to get the coupon rate per payment period = c/payment frequency
                  $couponRateForPeriod = MathFuncs::div(
                      $this->bondAnnualCouponRate,

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $VIRForPeriod is not named in camelCase.
      Open

              public function getBondFairValue()
              {
                  // we need to get the coupon rate per payment period = c/payment frequency
                  $couponRateForPeriod = MathFuncs::div(
                      $this->bondAnnualCouponRate,

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $VIRForPeriod is not named in camelCase.
      Open

              public function getBondFairValue()
              {
                  // we need to get the coupon rate per payment period = c/payment frequency
                  $couponRateForPeriod = MathFuncs::div(
                      $this->bondAnnualCouponRate,

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $VIRForPeriod is not named in camelCase.
      Open

              public function getBondFairValue()
              {
                  // we need to get the coupon rate per payment period = c/payment frequency
                  $couponRateForPeriod = MathFuncs::div(
                      $this->bondAnnualCouponRate,

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $PVofUnitBondAnnuity is not named in camelCase.
      Open

              public function getBondFairValue()
              {
                  // we need to get the coupon rate per payment period = c/payment frequency
                  $couponRateForPeriod = MathFuncs::div(
                      $this->bondAnnualCouponRate,

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status