CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Function preprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess(){
        $this->title = "Timeclock - EXPORT";
        $this->header = "TimeclockExport";
        $this->report_cache = 'none';

Severity: Minor
Found in fannie/modules/plugins2.0/TimesheetPlugin/TimesheetExport.php - About 25 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

Function roundTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function roundTime($number) {
        // This function takes a two digit precision number and rounds it to the nearest quarter.
        
        $roundhour = explode('.', number_format($number, 2));
                      
Severity: Minor
Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php - About 25 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

Function get_id_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_id_handler()
    {
        $prep = $this->connection->prepare("SELECT memType, FirstName, LastName
            FROM custdata
            WHERE CardNo=? AND personNum=1");
Severity: Minor
Found in fannie/modules/plugins2.0/PIKiller/AccessSignupPage.php - About 25 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

Function get_id_edit_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function get_id_edit_view(){
        ob_start();
        echo '<tr><td>';
        echo '<form action="PISuspensionPage.php" method="post">';
        echo '<input type="hidden" name="id" value="'.$this->id.'" />';
Severity: Minor
Found in fannie/modules/plugins2.0/PIKiller/PISuspensionPage.php - About 25 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

Function preprocess has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function preprocess(){
        global $FANNIE_OP_DB,$FANNIE_PLUGIN_SETTINGS;
        $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
        if (isset($_GET['submitted']) && $_GET['confirm'] == 'confirm') {
            // Delete then redirect...
Severity: Minor
Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminDelete.php - About 25 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

Function parseTime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseTime($time, $mer) {
        $hour = array();
        if (strlen($time) == 2 && is_numeric($time)) {
            $time = $time . ':00';
        } elseif (strlen($time) == 4 && is_numeric($time)) {
Severity: Minor
Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php - About 25 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

Function body_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function body_content(){
        global $FANNIE_OP_DB, $FANNIE_PLUGIN_SETTINGS;
        $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);

        include('./includes/header.html');
Severity: Minor
Found in fannie/modules/plugins2.0/TimesheetPlugin/TsAreasReport.php - About 25 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

Function body_content has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function body_content(){
        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
        $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);

        ob_start();
Severity: Minor
Found in fannie/modules/plugins2.0/TimesheetPlugin/TimesheetGeneralReport.php - About 25 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

Function sortIngredients has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function sortIngredients($ing)
    {
        $compare = function($a, $b) {
            if ($a['volume'] < $b['volume']) {
                return 1;
Severity: Minor
Found in fannie/modules/plugins2.0/ChefTec/CTRecipes.php - About 25 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

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

    public function fetch_report_data()
    {
        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;
        $dbc = FannieDB::get($FANNIE_PLUGIN_SETTINGS['GiveUsMoneyDB']);
        $dt = FormLib::get('endDate', date('Y-m-d'));

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 fetch_report_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetch_report_data()
    {
        $store = FormLib::get('store');
        $card = FormLib::get('card_no');
        $dlog = DTransactionsModel::selectDlog($this->form->date1, $this->form->date2);
Severity: Minor
Found in fannie/modules/plugins2.0/ChefTec/CTNabsInvoice.php - About 25 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

Function calculate_footers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculate_footers($data) {
        if (count($data[0]) == 3) {
            $sumS = 0;
            $sumV = 0;
            foreach($data as $row) {
Severity: Minor
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/reports/GumEquityReport.php - About 25 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

Function post_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_handler()
    {
        $stores = new StoresModel($this->connection);
        $stores->hasOwnItems(1);
        $stores = $stores->find();
Severity: Minor
Found in fannie/modules/plugins2.0/OverShortTools/OverShortParsPage.php - About 25 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

Function formTableBody has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function formTableBody($items)
    {
        $dbc = CTDB::get();

        $recipes = array();
Severity: Minor
Found in fannie/modules/plugins2.0/ChefTec/SignsFromCheftec.php - About 25 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

Function stockFirst has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function stockFirst($store)
    {
        $nameP = $this->connection->prepare("SELECT likeCodeDesc FROM likeCodes WHERE likeCode=?");
        $batchP = $this->connection->prepare("SELECT l.batchID FROM batchList AS l
            INNER JOIN batches AS b ON l.batchID=b.batchID
Severity: Minor
Found in fannie/modules/plugins2.0/RP/RpDailyPage.php - About 25 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

Function get_id_welcome_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_id_welcome_handler()
    {
        global $FANNIE_PLUGIN_SETTINGS, $FANNIE_OP_DB;

        $bridge = GumLib::getSetting('posLayer');
Severity: Minor
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumEmailPage.php - About 25 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

Function post_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_view()
    {
        $model = new RpOrderItemsModel($this->connection);
        $model->storeID(FormLib::get('store'));
        $model->categoryID(FormLib::get('catID'));
Severity: Minor
Found in fannie/modules/plugins2.0/RP/RpDualPage.php - About 25 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

Function get_id_pdf_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_id_pdf_handler()
    {
        if (!class_exists('FPDF')) {
            include(__DIR__ . '/../../../src/fpdf/fpdf.php');
            define('FPDF_FONTPATH','font/');
Severity: Minor
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumEquityPayoffPage.php - About 25 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

Function calculate_footers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculate_footers($data)
    {
        if ($this->multi_counter == 1) {
            $sum = 0.0;
            $due = 0.0;
Severity: Minor
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/reports/GumBothReport.php - About 25 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

Function get_id_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_id_view()
    {
        global $FANNIE_URL;
        $ret = '';

Severity: Minor
Found in fannie/modules/plugins2.0/GiveUsMoneyPlugin/GumEmailPage.php - About 25 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

Severity
Category
Status
Source
Language