CORE-POS/IS4C

View on GitHub

Showing 8,683 of 8,684 total issues

Method body_content has 204 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

        $emp_no = (int) $this->emp_no;
Severity: Major
Found in fannie/modules/plugins2.0/TimesheetPlugin/admin/TsAdminView.php - About 1 day to fix

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

                if ($a_amt > 0) {
                    $record = DTrans::defaults();
                    $record['register_no'] = $LANE_NO;
                    $record['emp_no'] = $EMP_NO;
                    $record['trans_no'] = $trans;
    fannie/modules/plugins2.0/WfcAbandonEquity/WfcAbandonEquityImport.php on lines 159..178

    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 247.

    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 2 locations. Consider refactoring.
    Open

                if ($b_amt > 0) {
                    $record = DTrans::defaults();
                    $record['register_no'] = $LANE_NO;
                    $record['emp_no'] = $EMP_NO;
                    $record['trans_no'] = $trans;
    fannie/modules/plugins2.0/WfcAbandonEquity/WfcAbandonEquityImport.php on lines 139..158

    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 247.

    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 2 locations. Consider refactoring.
    Open

        protected $preview_opts = array(
            'upc' => array(
                'display_name' => 'UPC *',
                'default' => 19,
                'required' => true
    Severity: Major
    Found in fannie/purchasing/importers/AlbertsInvoiceImport.php and 1 other location - About 1 day to fix
    fannie/modules/plugins2.0/LBMX/LbmxReformat2.php on lines 13..64

    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 247.

    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 2 locations. Consider refactoring.
    Open

        protected $preview_opts = array(
            'vendorID' => array(
                'display_name' => 'Vendor ID',
                'default' => 60,
                'required' => true
    Severity: Major
    Found in fannie/modules/plugins2.0/LBMX/LbmxReformat2.php and 1 other location - About 1 day to fix
    fannie/purchasing/importers/AlbertsInvoiceImport.php on lines 37..88

    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 247.

    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

    Function getTable has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getTable()
        {
            $this->addScript('pricing-batch-II.js');
            $dbc = $this->connection;
            $dbc->selectDB($this->config->OP_DB);
    Severity: Minor
    Found in fannie/batches/UNFI/VPBPV.php - About 1 day 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 52 (exceeds 5 allowed). Consider refactoring.
    Open

        function fetch_report_data(){
            global $FANNIE_OP_DB, $FANNIE_COOP_ID;
            $d1 = $this->form->date1;
            $d2 = $this->form->date2;
            $dept = FormLib::get_form_value('dept',0);
    Severity: Minor
    Found in fannie/reports/StoreSummary/StoreSummaryReport.php - About 1 day 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 52 (exceeds 5 allowed). Consider refactoring.
    Open

        public function preprocess()
        {
            global $FANNIE_PLUGIN_SETTINGS;
            $ts_db = FannieDB::get($FANNIE_PLUGIN_SETTINGS['TimesheetDatabase']);
            $this->header = 'Timeclock - Entry';
    Severity: Minor
    Found in fannie/modules/plugins2.0/TimesheetPlugin/TimesheetPage.php - About 1 day 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_confirm_view has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_id_confirm_view()
        {
            
            $ret = '';
            $data = array();

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

        static public function queueableItemFromWhere($form)
        {
            $op_db = FannieConfig::config('OP_DB');
            $dbc = FannieDB::getReadOnly($op_db);
            try {
    Severity: Minor
    Found in fannie/classlib2.0/lib/FormLib.php - About 1 day 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_dept_view has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

        public function get_dept_view()
        {
            $dbc = $this->connection;
            $dbc->selectDB($this->config->get('OP_DB'));
            $dept_no = FormLib::get('dept_no');
    Severity: Minor
    Found in fannie/item/DepartmentDiscrepancyPage.php - About 1 day 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 ResolveReferences has a Cognitive Complexity of 67 (exceeds 20 allowed). Consider refactoring.
    Open

            private JsonSchema ResolveReferences(JsonSchema schema)
            {
                if (schema.DeferredReference != null)
                {
                    string reference = schema.DeferredReference;

    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 HandleReadData has a Cognitive Complexity of 67 (exceeds 20 allowed). Consider refactoring.
    Open

        protected void HandleReadData(byte[] input){
            int msg_sum = 0;
            if (usb_report_size == 64){
                byte[] temp_in = new byte[65];
                temp_in[0] = 0;
    Severity: Minor
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 day 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 post_handler has 202 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function post_handler()
        {
            try {
                $pDate = $this->form->date;
                $invoice = $this->form->invoice;
    Severity: Major
    Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixReturn.php - About 1 day to fix

      Method post_handler has 202 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function post_handler()
          {
              try {
                  $pDate = $this->form->date;
                  $invoice = $this->form->invoice;
      Severity: Major
      Found in fannie/modules/plugins2.0/PaycardFix/PaycardFixSale.php - About 1 day to fix

        Method definition has 201 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function definition()
            {
                $con = $this->connection;
                $viewSQL = "
                    select 
        Severity: Major
        Found in pos/is4c-nf/lib/models/trans/ScreenDisplayModel.php - About 1 day to fix

          Method preprocess has 200 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function preprocess()
              {
                  global $FANNIE_OP_DB;
                  $sql = FannieDB::get($FANNIE_OP_DB);
          
          
          Severity: Major
          Found in fannie/modules/plugins2.0/DeliInventory/DeliInventoryPage.php - About 1 day to fix

            Method run has 200 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run()
                {
                    global $FANNIE_OP_DB;
                    $dbc = FannieDB::get($FANNIE_OP_DB);
            
            
            Severity: Major
            Found in fannie/modules/plugins2.0/WfcVirtualCoupon/WfcVcTask.php - About 1 day to fix

              Class JToken has 56 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  public abstract class JToken : IJEnumerable<JToken>, IJsonLineInfo
              #if !(NETFX_CORE || PORTABLE40 || PORTABLE)
                      , ICloneable
              #endif
              #if !(NET35 || NET20 || PORTABLE40)

                Method run has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function run()
                    {
                        global $FANNIE_OP_DB;
                        $dbc = FannieDB::get($FANNIE_OP_DB);
                
                
                Severity: Major
                Found in fannie/modules/plugins2.0/WfcGazetteBilling/WfcB2BTask.php - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language