CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

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

function generateServiceCaseTag($x, $y, $guide, $width, $height, $pdf, $row, $dbc)
{
    $upc = $row['upc'];
    $desc = $row['description'];
    $showPrice = FormLib::get('showPrice', false);
Severity: Minor
Found in fannie/admin/labels/pdf_layouts/WFC_Dark_ServiceCase_12UP.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

    public function sortIngredients($ing)
    {
        $compare = function($a, $b) {
            if ($a['volume'] < $b['volume']) {
                return 1;
Severity: Minor
Found in fannie/admin/labels/pdf_layouts/Cheftec_Signs_4UP.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 GetCheckDigit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function GetCheckDigit($barcode)
    {
      //Compute the check digit
      $sum=0;
      for($i=1;$i<=11;$i+=2)
Severity: Minor
Found in fannie/admin/labels/FpdfWithBarcode.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 unknownSubscribed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function unknownSubscribed($record, $columns, $chimp, $LISTID, $memlist)
    {
        list($card_no, $email, $fname, $lname, $changed) = $this->unpackRecord($record, $columns);
        if ($card_no === false) {
            return $memlist;
Severity: Minor
Found in fannie/modules/plugins2.0/MailChimpSync/MailChimpTask.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_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function get_view()
    {
        $all = FannieAPI::listModules('BasicModel');
        $assort = array();
        foreach ($all as $a) {
Severity: Minor
Found in fannie/install/sql/MagicDoc.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 readMergeFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function readMergeFields($chimp, $LISTID)
    {
        $vars = $chimp->get("lists/{$LISTID}/merge-fields");
        $field_id = false;
        foreach ($vars['merge_fields'] as $mf) {
Severity: Minor
Found in fannie/modules/plugins2.0/MailChimpSync/MailChimpTask.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_view has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_view()
    {
        $lib_class = $this->lib_class;
        $dbc = $lib_class::getDB();

Severity: Minor
Found in fannie/modules/plugins2.0/OpenBookFinancing/ObfMappingPage.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 printItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function printItems($items, $curPlu=false, $withCancel=true)
    {
        $ret = '';
        $i = 0;
        $dbc = FannieDB::get($this->config->get('OP_DB'));
Severity: Minor
Found in fannie/modules/plugins2.0/WfcClassRegistry/WfcClassRegistryPage.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 array_dump has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    function array_dump(){
        $ret = array();
        foreach ($this->DATA as $field=>$value){
            if (isset($value[0]) &&
                isset($value[0]["chardata"]))
Severity: Minor
Found in fannie/src/xmlData.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 getResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getResult($response_body, $export_mode)
    {
        if ($export_mode) {
            $result = explode("\n", $response_body);
            for ($i=0; $i<count($result); $i++) {
Severity: Minor
Found in fannie/modules/plugins2.0/MailChimpSync/MailChimpEx.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get($storeID, $outputDir)
    {
        $filename = date('YmdHis') . '_' . $this->name;
        $fptr = fopen($outputDir . DIRECTORY_SEPARATOR . $filename, 'w');
        $term = "\r\n";
Severity: Minor
Found in fannie/modules/plugins2.0/RAFeeds/RaItemFeed.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 pickList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function pickList($orderID, $store)
    {
        $prep = $this->connection->prepare("
            SELECT p.upc, p.brand, p.description, p.quantity, q.size, q.scale
            FROM PickupOrderItems AS p
Severity: Minor
Found in fannie/modules/plugins2.0/Pickup/ViewPickups.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 writeICal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function writeICal($id, $filename)
    {
        global $FANNIE_OP_DB;
        $dbc = CalendarPluginDB::get();
        $cal = new CalendarsModel($dbc); 
Severity: Minor
Found in fannie/modules/plugins2.0/CalendarPlugin/CalendarFeed.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

    protected function get_id_view()
    {
        $id = trim($this->id);
        if (!preg_match('/^\d+-\d+$/', $id)) {
            return '<div class="alert alert-danger">Order Number should be two numbers separated by a dash</div>
Severity: Minor
Found in fannie/modules/plugins2.0/Pickup/PickupOrders.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_id_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_id_handler()
    {
        $uid = FannieAuth::getUID();
        $settings = $this->config->get('PLUGIN_SETTINGS');
        $this->connection->selectDB($settings['CommentDB']);
Severity: Minor
Found in fannie/modules/plugins2.0/CommentTracker/ManageComments.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()
    {
        $editCSS = FannieAuth::validateUserQuiet('hr_editor') ? '' : 'collapse';
        $settings = $this->config->get('PLUGIN_SETTINGS');
        $dbc = FannieDB::get($settings['HrWebDB']);
Severity: Minor
Found in fannie/modules/plugins2.0/HrWeb/IllnessReport/IllnessLogReport.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_id_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function post_id_handler()
    {
        $month = isset($_REQUEST['month'])?$_REQUEST['month']:'';
        $year = isset($_REQUEST['year'])?$_REQUEST['year']:'';
        $pos = $_REQUEST['pos'];
Severity: Minor
Found in fannie/modules/plugins2.0/WfcHoursTracking/eval/WfcHtEvalView.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 process_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function process_file($linedata, $indexes)
    {
        $queue = new COREPOS\Fannie\API\jobs\QueueManager();
        foreach ($linedata as $line) {
            $id = trim($line[$indexes['cardno']]);
Severity: Minor
Found in fannie/modules/plugins2.0/Addresses/ForwardingAddressUpload.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 startTaxes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function startTaxes($dbc)
    {
        $model = new TaxRatesModel($dbc);
        $taxes = $model->find();
        foreach ($this->config->get('LANES') as $lane) {
Severity: Minor
Found in fannie/modules/plugins2.0/TaxHoliday/TaxHolidaysTask.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_json_handler has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_json_handler()
    {
        $json = json_decode(base64_decode($this->json), true);
        if (!is_array($json)) {
            echo 'Invalid data!';
Severity: Minor
Found in fannie/modules/plugins2.0/PIKiller/PIApply.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