CORE-POS/IS4C

View on GitHub
fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php

Summary

Maintainability
F
1 wk
Test Coverage

File ObfWeeklyReportV2.php has 847 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************

    Copyright 2014 Whole Foods Co-op

Severity: Major
Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 2 days to fix

    Method fetch_report_data has 405 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function fetch_report_data()
        {
            $class_lib = $this->class_lib;
            $dbc = $class_lib::getDB();
            
    Severity: Major
    Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 2 days to fix

      Function fetch_report_data has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fetch_report_data()
          {
              $class_lib = $this->class_lib;
              $dbc = $class_lib::getDB();
              
      Severity: Minor
      Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method getOtherStore has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getOtherStore($storeID, $weekID)
          {
              $dbc = $this->connection;
              $conf = $this->config->get('PLUGIN_SETTINGS');
              $dbc->selectDB($conf['ObfDatabaseV2']);
      Severity: Major
      Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 2 hrs to fix

        Method getPlanSales has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getPlanSales($weekID)
            {
                if ($weekID >= 374) {
                    $prep = $this->connection->prepare("select c.obfCategoryID, m.superID, b.storeID, b.planGoal  
                        from " . FannieDB::fqn('ObfBudget', 'plugin:ObfDatabaseV2') . " AS b 
        Severity: Major
        Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 2 hrs to fix

          Method chartData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function chartData($dbc, $weekID, $storeID)
              {
                  $begin = $weekID - 12;
                  $json = array(
                      'labels' => array(),
          Severity: Minor
          Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 2 hrs to fix

            Function getPlanRange has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function getPlanRange($startWeek, $endWeek, $categoryID, $superID)
                {
                    $ret = 0;
                    for ($weekID = $startWeek; $weekID <= $endWeek; $weekID++) {
                        if ($weekID >= 218) {
            Severity: Minor
            Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function getPlanSales has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getPlanSales($weekID)
                {
                    if ($weekID >= 374) {
                        $prep = $this->connection->prepare("select c.obfCategoryID, m.superID, b.storeID, b.planGoal  
                            from " . FannieDB::fqn('ObfBudget', 'plugin:ObfDatabaseV2') . " AS b 
            Severity: Minor
            Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method discountsThisWeek has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function discountsThisWeek($dbc, $start_ts, $end_ts, $start_ly, $end_ly)
                {
                    $date1 = date('Y-m-d', $start_ts);
                    $date2 = date('Y-m-d', $end_ts);
                    $date3 = date('Y-m-d', $start_ly);
            Severity: Minor
            Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 1 hr to fix

              Function getOtherStore has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function getOtherStore($storeID, $weekID)
                  {
                      $dbc = $this->connection;
                      $conf = $this->config->get('PLUGIN_SETTINGS');
                      $dbc->selectDB($conf['ObfDatabaseV2']);
              Severity: Minor
              Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                  private function discountsThisWeek($dbc, $start_ts, $end_ts, $start_ly, $end_ly)
              Severity: Minor
              Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 35 mins to fix

                Function chartData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function chartData($dbc, $weekID, $storeID)
                    {
                        $begin = $weekID - 12;
                        $json = array(
                            'labels' => array(),
                Severity: Minor
                Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Avoid too many return statements within this method.
                Open

                            return $this->PLAN_SALES;
                Severity: Major
                Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return $this->PLAN_SALES_Q3_2018;
                  Severity: Major
                  Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $this->PLAN_SALES_Q1_2018;
                    Severity: Major
                    Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return 162;
                      Severity: Major
                      Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $this->PLAN_SALES_Q2_2018;
                        Severity: Major
                        Found in fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php - About 30 mins to fix

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                              private function weekToYM($weekID)
                              {
                                  $prep = $this->connection->prepare('SELECT startDate
                                      FROM ' . FannieDB::fqn('ObfWeeks', 'plugin:ObfDatabaseV2') . '
                                      WHERE obfWeekID=?');
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 143..165

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 294.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  $data[] = array(
                                      'Average Basket',
                                      number_format($total_sales->lastYear / $total_trans->lastYear, 2),
                                      number_format($total_sales->projected / $proj_trans, 2),
                                      '',
                          fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 779..793

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 243.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      $record = array(
                                          'Total',
                                          number_format($sum[1], 0),
                                          number_format($dept_proj, 0),
                                          number_format($dept_proj, 0), // % of store sales re-written later
                          fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 399..413

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 196.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  } elseif ($weekID >= 218) {
                                      $prep = $this->connection->prepare("
                                          SELECT l.obfCategoryID, s.superID, (1+l.growthTarget)*s.lastYearSales AS plan
                                          FROM " . FannieDB::fqn('ObfLabor', 'plugin:ObfDatabaseV2') . " AS l
                                              INNER JOIN " . FannieDB::fqn('ObfCategories', 'plugin:ObfDatabaseV2') . " AS c ON l.obfCategoryID=c.obfCategoryID
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 238..253

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 164.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  $data[] = array(
                                      'Sales',
                                      number_format($total_sales->lastYear, 0),
                                      number_format($total_sales->projected, 0),
                                      '',
                          fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 645..659

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 163.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  $data[] = array(
                                      'Transactions',
                                      number_format($total_trans->lastYear),
                                      number_format($proj_trans),
                                      '',
                          fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 763..777

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 138.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                                      $data[] = array(
                                          'Hours',
                                          '',
                                          number_format($proj_hours, 0),
                                          '',
                          fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 557..571
                          fannie/modules/plugins2.0/OpenBookFinancing/ObfWeeklyReport.php on lines 574..588

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 132.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 14 locations. Consider refactoring.
                          Open

                              protected $PLAN_SALES_Q2_2018 = array(
                                  '1,6' => 51031.00,      // Hillside Produce
                                  '2,10' => 11448.32,     // Hillside Deli
                                  '2,11' => 31119.86,
                                  '2,16' => 12686.82,
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 35..60
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 62..87
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 89..114
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 116..141
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 50..75
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 77..102
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 104..129
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 131..156
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 158..183
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 99..124
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 126..151
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 180..205
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 207..232

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 127.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 14 locations. Consider refactoring.
                          Open

                              protected $PLAN_SALES_Q1_2018 = array(
                                  '1,6' => 53904.29,      // Hillside Produce
                                  '2,10' => 12187.19,     // Hillside Deli
                                  '2,11' => 33128.32,
                                  '2,16' => 13505.62,
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 35..60
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 62..87
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 89..114
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 116..141
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 50..75
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 77..102
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 104..129
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 131..156
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 158..183
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 99..124
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 153..178
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 180..205
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 207..232

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 127.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 14 locations. Consider refactoring.
                          Open

                              protected $PLAN_SALES = array(
                                  '1,6' => 51193.05,      // Hillside Produce
                                  '2,10' => 11416.48,     // Hillside Deli
                                  '2,11' => 31032.00,
                                  '2,16' => 12651.44,
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 35..60
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 62..87
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 89..114
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 116..141
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 50..75
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 77..102
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 104..129
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 131..156
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 158..183
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 126..151
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 153..178
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 180..205
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 207..232

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 127.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 14 locations. Consider refactoring.
                          Open

                              protected $PLAN_SALES_Q4_2018 = array(
                                  '1,6' => 52231.00,      // Hillside Produce
                                  '2,10' => 11840.47,     // Hillside Deli
                                  '2,11' => 32186.37,
                                  '2,16' => 13122.16,
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 35..60
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 62..87
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 89..114
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 116..141
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 50..75
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 77..102
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 104..129
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 131..156
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 158..183
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 99..124
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 126..151
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 153..178
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 180..205

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 127.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 14 locations. Consider refactoring.
                          Open

                              protected $PLAN_SALES_Q3_2018 = array(
                                  '1,6' => 51510.00,      // Hillside Produce
                                  '2,10' => 11676.94,     // Hillside Deli
                                  '2,11' => 31742.34,
                                  '2,16' => 12940.72,
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 35..60
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 62..87
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 89..114
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfBigBoardReport.php on lines 116..141
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 50..75
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 77..102
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 104..129
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 131..156
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfSummaryReport.php on lines 158..183
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 99..124
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 126..151
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 153..178
                          fannie/modules/plugins2.0/OpenBookFinancingV2/ObfWeeklyReportV2.php on lines 207..232

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 127.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status