estimancy/projestimate

View on GitHub

Showing 836 of 1,675 total issues

Avoid deeply nested control flow statements.
Open

                        if(config.inGraphDataYPosition==1) { yPos=xAxisPosY - yStart[j] - config.inGraphDataPaddingY; }
                        else if(config.inGraphDataYPosition==2) { yPos=xAxisPosY -(calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2) )/2 - yStart[j] - config.inGraphDataPaddingY; }
                        else if(config.inGraphDataYPosition==3) { yPos=xAxisPosY -calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2)  - yStart[j] - config.inGraphDataPaddingY; }
Severity: Major
Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (typeof (data.labels[j]) == "string") lgtxt2 = data.labels[j].trim();
                            else lgtxt2 = "";
    Severity: Major
    Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if(config.inGraphDataYPosition==1) { yPos=barOffset + barWidth - config.inGraphDataPaddingY; }
                              else if(config.inGraphDataYPosition==2) { yPos=barOffset + barWidth/2- config.inGraphDataPaddingY; }
                              else if(config.inGraphDataYPosition==3) { yPos=barOffset- config.inGraphDataPaddingY; }
      Severity: Major
      Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      unless ext_ancestry.nil?
                        ext_ancestry_list = ext.ancestry.split('/')
                        ext_ancestry_list.each do |ancestor|
                          ext_ancestor_uuid = ExternalMasterDatabase::ExternalWbsActivityElement.find_by_id(ancestor).uuid
                          ancestors << WbsActivityElement.find_by_uuid(ext_ancestor_uuid).id
        Severity: Major
        Found in app/models/home.rb - About 45 mins to fix

          Function calculateScale has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function calculateScale(config, maxSteps, minSteps, maxValue, minValue, labelTemplateString) {
          Severity: Minor
          Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                              if (mxlb<maxL)maxL=mxlb;
            Severity: Major
            Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                         if(config.inGraphDataRotate=="inRadiusAxis" || posAngle< Math.PI/2 || (posAngle > 3*Math.PI/2 && posAngle < 5*Math.PI/2))ctx.textAlign = "left";
                                         else ctx.textAlign="right";
              Severity: Major
              Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (distance < 10) {
                
                                annotateDIV.style.border = config.annotateBorder;
                                annotateDIV.style.padding = config.annotatePadding;
                                annotateDIV.style.borderRadius = config.annotateBorderRadius;
                Severity: Major
                Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (typeof (data.labels[j]) == "string") lgtxt2 = data.labels[j].trim();
                                              else lgtxt2 = "";
                  Severity: Major
                  Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if(config.inGraphDataYPosition==1) { yPos=xAxisPosY - config.inGraphDataPaddingY; }
                                            else if(config.inGraphDataYPosition==2) { yPos=xAxisPosY -(calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2))/2- config.inGraphDataPaddingY; }
                                            else if(config.inGraphDataYPosition==3) { yPos=xAxisPosY -calculateOffset(config, data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2)- config.inGraphDataPaddingY; }
                    Severity: Major
                    Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                            self.expert_judgement_instance.nil? ? 'Undefined model' : self.expert_judgement_instance.to_s(self)
                      Severity: Major
                      Found in app/models/module_project.rb - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if (bw.ie4 || bw.ie5) y = y + eval(scrolled);
                        Severity: Major
                        Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                   else if(config.inGraphDataAlign=="to-center"){
                                                     if(config.inGraphDataRotate=="inRadiusAxis" || posAngle< Math.PI/2 || (posAngle > 3*Math.PI/2 && posAngle < 5*Math.PI/2))ctx.textAlign = "right";
                                                     else ctx.textAlign="left";
                                                   }
                                                              else ctx.textAlign = config.inGraphDataAlign;
                          Severity: Major
                          Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                     else if(config.inGraphDataVAlign=="to-center"){
                                                        if((posAngle> Math.PI && posAngle<2*Math.PI) || (posAngle< 0 && posAngle>-Math.PI) || (posAngle< -2*Math.PI && posAngle>-3*Math.PI))ctx.textBaseline = "bottom";
                                                        else ctx.textBaseline = "top";
                                                     }
                                                     else ctx.textBaseline = config.inGraphDataVAlign;
                            Severity: Major
                            Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (typeof (data.labels[j]) == "string") lgtxt2 = data.labels[j].trim();
                                                          else lgtxt2 = "";
                              Severity: Major
                              Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (nbcols == nbLegendCols) {
                                                            nbcols = 0;
                                                            xpos = xFirstLegendTextPos;
                                                            ypos += config.legendFontSize + config.legendSpaceBetweenTextVertical;
                                                        }
                                Severity: Major
                                Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      unless pf.nil?
                                                        pf.views_widget_id = widget_copy.id
                                                        pf.save
                                                      end
                                  Severity: Major
                                  Found in app/models/project.rb - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if(config.inGraphDataXPosition==1) { xPos=barOffset+config.inGraphDataPaddingX; } 
                                                            else if(config.inGraphDataXPosition==2) { xPos=barOffset+barWidth/2+config.inGraphDataPaddingX ;}
                                                            else if(config.inGraphDataXPosition==3) { xPos=barOffset+barWidth+config.inGraphDataPaddingX;} 
                                    Severity: Major
                                    Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if (typeof (data.labels[j]) == "string") lgtxt2 = data.labels[j].trim();
                                                              else lgtxt2 = "";
                                      Severity: Major
                                      Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if(config.inGraphDataYPosition==1) { yPos=barOffset + barWidth - config.inGraphDataPaddingY; }
                                                                else if(config.inGraphDataYPosition==2) { yPos=barOffset + barWidth/2- config.inGraphDataPaddingY; }
                                                                else if(config.inGraphDataYPosition==3) { yPos=barOffset- config.inGraphDataPaddingY; }
                                        Severity: Major
                                        Found in app/assets/javascripts/ChartNew.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language