ProgramPanel.java

Index Score
util.ui
TV-Browser

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
JAVA0285JAVA0285 Dereference of potentially null variable
DECL_COMMENTSComments in declarations
COMPARISONSNumber of comparison operators
EXITSProcedure exits
EXEC_COMMENTSComments in executable code
CYCLOMATICCyclomatic complexity
SIZESize of the file in bytes
BLOCKSNumber of blocks
OPERATORSNumber of operators
DOC_COMMENTNumber of javadoc comment lines
PROGRAM_LENGTHHalstead program length
OPERANDSNumber of operands
COMMENTSComment lines
LINESNumber of lines in the source file
LOGICAL_LINESNumber of statements
UNIQUE_OPERANDSNumber of unique operands
LINE_COMMENTNumber of line comments
PROGRAM_VOCABHalstead program vocabulary
ELOCEffective lines of code
LOCLines of code
JAVA0144JAVA0144 Line exceeds maximum M characters
FUNCTIONSNumber of function declarations
JAVA0049JAVA0049 Nested block at depth N (maximum: M)
JAVA0034JAVA0034 Missing braces in if statement
PARAMSNumber of formal parameter declarations
INTERFACE_COMPLEXITYInterface complexity
JAVA0076JAVA0076 Use of magic number
RETURNSNumber of return points from functions
UNIQUE_OPERATORSNumber of unique operators
NEST_DEPTHMaximum nesting depth
JAVA0068JAVA0068 Modifiers not declared in recommended order
WHITESPACENumber of whitespace lines
PROGRAM_VOLUMEHalstead program volume
JAVA0136JAVA0136 N methods defined in class (maximum: M)
JAVA0126JAVA0126 Method declares unchecked exception in throws
JAVA0087JAVA0087 Use of Thread.sleep()
JAVA0067JAVA0067 Array descriptor on identifier name
JAVA0100JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0145JAVA0145 Tab character used in source file
/* * TV-Browser * Copyright (C) 04-2003 Martin Oberhauser (martin_oat@yahoo.de) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * CVS information: * $RCSfile$ * $Source$ * $Date: 2008-04-21 16:59:04 -0400 (Mon, 21 Apr 2008) $ * $Author: rd_rnnr $ * $Revision: 4555 $ */ package util.ui; import devplugin.ContextMenuIf; import devplugin.Marker; import devplugin.Plugin; import devplugin.Program; import devplugin.ProgramFieldType; import devplugin.ProgramInfoHelper; import tvbrowser.core.Settings; import tvbrowser.core.plugin.PluginProxy; import tvbrowser.core.plugin.PluginProxyManager; import tvbrowser.core.plugin.PluginStateListener; import util.io.IOUtilities; import util.misc.StringPool; import util.program.ProgramUtilities; import util.settings.ProgramPanelSettings; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JComponent; import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Composite; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Stroke; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.IOException; import java.io.Reader; import java.util.ArrayList; import java.util.logging.Level; /** * A ProgramPanel is a JComponent representing a single program. * * @author Martin Oberhauser * @author Til Schneider, www.murfman.de */ public class ProgramPanel extends JComponent implements ChangeListener, PluginStateListener { private static java.util.logging.Logger mLog = java.util.logging.Logger .getLogger(TextAreaIcon.class.getName()); private static final boolean USE_FULL_HEIGHT = true; private static final Composite NORMAL_COMPOSITE = AlphaComposite.SrcOver; private static final Composite PALE_COMPOSITE = AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 0.5F); /** The title font. */ private static Font mTitleFont; /** The time font. */ private static Font mTimeFont; /** The normal font */ private static Font mNormalFont; /** * the font size offset for the currently selected dynamic font size */ private static int fontSizeOffset = 0; private static int columnWidthOffset = 0; /** The width of the left part (the time). */ private static int WIDTH_LEFT = -1; /** The width of the right part (the title and short info). */ private static int WIDTH_RIGHT = Settings.propColumnWidth.getInt() - WIDTH_LEFT; /** The total width. */ private static int WIDTH = WIDTH_LEFT + WIDTH_RIGHT; /** Formatter for the Time-String */ private static final TimeFormatter TIME_FORMATTER = new TimeFormatter(); /** The height. */ private int mHeight = 0; /** * The preferred height. * <p> * It's the height the panel has with a maximum of 3 information rows. */ private int mPreferredHeight = 0; /** The start time as String. */ private String mProgramTimeAsString; /** The icon used to render the title. */ private TextAreaIcon mTitleIcon; /** The icon used to render the description. */ private TextAreaIcon mDescriptionIcon; /** The icon used to paint the picture with */ private PictureAreaIcon mPictureAreaIcon; /** The icons to show on the left side under the start time. */ private Icon[] mIconArr; /** The program. */ private Program mProgram; /** Color of the Text */ private Color mTextColor = Settings.propProgramPanelForegroundColor.getColor(); /** Panel under a Mouse ? */ private boolean mMouseOver = false; private boolean mIsSelected = false; /** Orientation Progressbar in X_AXIS * @deprecated since 2.7 Use {@link ProgramPanelSettings#X_AXIS} instead */ final public static int X_AXIS = ProgramPanelSettings.X_AXIS; /** Orientation Progressbar in Y_AXIS * @deprecated since 2.7 Use {@link ProgramPanelSettings#Y_AXIS} instead */ final public static int Y_AXIS = ProgramPanelSettings.Y_AXIS; /** Orientation of Progressbar */ private int mAxis = ProgramPanelSettings.Y_AXIS; /** The vertical gap between the programs */ private static int V_GAP = 5; private ProgramPanelSettings mSettings; private boolean mPaintExpiredProgramsPale = true; /** * Creates a new instance of ProgramPanel. */ public ProgramPanel() { this(new ProgramPanelSettings(Settings.propPictureType.getInt(), Settings.propPictureStartTime.getInt(), Settings.propPictureEndTime.getInt(), false, Settings.propIsPictureShowingDescription.getBoolean(), Settings.propPictureDuration.getInt(), Settings.propPicturePluginIds.getStringArray())); } /** * Creates a new instance of ProgramPanel. * @param settings The settings for this program panel. * * @since 2.2.2 */ public ProgramPanel(ProgramPanelSettings settings) { mSettings = settings; mAxis = settings.getAxis(); if (mTitleFont == null) { updateFonts(); } calculateWidth(); mTitleIcon = new TextAreaIcon(null, mTitleFont, WIDTH_RIGHT - 5); mDescriptionIcon = new TextAreaIcon(null, mNormalFont, WIDTH_RIGHT - 5); mDescriptionIcon.setMaximumLineCount(3); setBackground(UIManager.getColor("programPanel.background")); } private void calculateWidth() { if (WIDTH_LEFT == -1) { // distance between time and title shall match title font settings, but at most n pixels int distance = getFontMetrics(mTitleFont).stringWidth("n"); if (distance > 7) { distance = 7; } WIDTH_LEFT = getFontMetrics(mTimeFont).stringWidth(TIME_FORMATTER.formatTime(23, 59)) + distance; WIDTH_RIGHT = Settings.propColumnWidth.getInt() + columnWidthOffset - WIDTH_LEFT; WIDTH = WIDTH_LEFT + WIDTH_RIGHT; } } /** * Creates a new instance of ProgramPanel. * * @param prog * The program to show in this panel. */ public ProgramPanel(Program prog) { this(); setProgram(prog); } /** * Creates a new instance of ProgramPanel. * * @param prog * The program to show in this panel. * @param settings The settings for this program panel. * * @since 2.2.2 */ public ProgramPanel(Program prog, ProgramPanelSettings settings) { this(settings); setProgram(prog); } /** * Creates a new instance of ProgramPanel. * * @param prog * The program to show in this panel. * @param axis * Orientation of ProgressBar (X_AXIS/Y_AXIS) * @param settings The settings for this program panel. * * @since 2.2.2 */ public ProgramPanel(Program prog, int axis, ProgramPanelSettings settings) { this(settings); mAxis = axis; setProgram(prog); } /** * Reloads the font settings and sets a dynamic font size * @param newOffset increase or decrease compared to standard font size * @since 2.6 */ public static boolean updateFonts(int newOffset) { Font oldTitleFont = mTitleFont; Font oldTimeFont = mTimeFont; Font oldNormalFont = mNormalFont; boolean useDefaults = Settings.propUseDefaultFonts.getBoolean(); if (useDefaults) { mTitleFont = Settings.propProgramTitleFont.getDefault(); mTimeFont = Settings.propProgramTimeFont.getDefault(); mNormalFont = Settings.propProgramInfoFont.getDefault(); } else { mTitleFont = Settings.propProgramTitleFont.getFont(); mTimeFont = Settings.propProgramTimeFont.getFont(); mNormalFont = Settings.propProgramInfoFont.getFont(); } if (newOffset == 0) { fontSizeOffset = 0; } else { fontSizeOffset += newOffset; } if (fontSizeOffset != 0) { mTitleFont = getDynamicFontSize(mTitleFont, fontSizeOffset); mTimeFont = getDynamicFontSize(mTimeFont, fontSizeOffset); mNormalFont = getDynamicFontSize(mNormalFont, fontSizeOffset); } // if the font didn't change, avoid updates if (mTitleFont.equals(oldTitleFont) && mTimeFont.equals(oldTimeFont) && mNormalFont.equals(oldNormalFont)) { return false; } // reset width of the left part, will be recalculated during first forceRepaint WIDTH_LEFT = -1; return true; } private static Font getDynamicFontSize(Font font, int offset) { float size = font.getSize2D() + offset; if (size < 4) { size = 4; } return font.deriveFont(size); } /** * Reloads the font settings and sets the dynamic font size * to standard font size again */ public static void updateFonts() { updateFonts(0); } /** * Change the settings of this panel. * * @param settings The settings of this panel. */ public void setProgramPanelSettings(ProgramPanelSettings settings) { mSettings = settings; } /** * Repaints the complete panel. */ public void forceRepaint() { calculateWidth(); mTitleIcon = new TextAreaIcon(null, mTitleFont, WIDTH_RIGHT - 5); mDescriptionIcon = new TextAreaIcon(null, mNormalFont, WIDTH_RIGHT - 5); mDescriptionIcon.setMaximumLineCount(3); mProgram.validateMarking(); Program p = mProgram; mProgram = null; setProgram(p); } /** * (Re)Loads the column width settings. */ public static void updateColumnWidth() { updateColumnWidth(0); } public static int updateColumnWidth(int newOffset) { if (newOffset == 0) { columnWidthOffset = 0; } else { columnWidthOffset += (20 * newOffset); } int columnWidth = Settings.propColumnWidth.getInt() + columnWidthOffset; if (columnWidth < Settings.MIN_COLUMN_WIDTH) { columnWidthOffset = Settings.MIN_COLUMN_WIDTH - Settings.propColumnWidth.getInt(); } if (columnWidth > Settings.MAX_COLUMN_WIDTH) { columnWidthOffset = Settings.MAX_COLUMN_WIDTH - Settings.propColumnWidth.getInt(); } columnWidth = Settings.propColumnWidth.getInt() + columnWidthOffset; WIDTH_RIGHT = columnWidth - WIDTH_LEFT; WIDTH = WIDTH_LEFT + WIDTH_RIGHT; return columnWidth; } /** * Gets the preferred height. * <p> * It's the height the panel has with a maximum of 3 information rows. * * @return The preferred height. */ public int getPreferredHeight() { return mPreferredHeight; } /** * Sets the height of this panel * * @param height */ public void setHeight(int height) { if (mHeight != height) { setProgram(getProgram(), height); mHeight = height; } } public void setMaximumHeight() { setProgram(getProgram(), 10000); } /** * Gets the height. * * @return The height. */ public int getHeight() { return mHeight; } /** * Sets the program this panel shows. * * @param program * The program to show in this panel. */ public void setProgram(devplugin.Program program) { setProgram(program, -1); } /** * Sets the program this panel shows. * * @param program * The program to show in this panel. * @param maxHeight * The maximum height the program should have (in pixels). */ public void setProgram(devplugin.Program program, int maxHeight) { Program oldProgram = mProgram; mProgram = program; mTitleIcon.setMaximumLineCount(-1); mDescriptionIcon.setMaximumLineCount(-1); boolean programChanged = (oldProgram != program); if (programChanged) { // Get the start time, filter duplicate strings mProgramTimeAsString = StringPool.getString(program.getTimeString()); // Set the new title mTitleIcon.setText(program.getTitle()); if(mProgram.getProgramState() == Program.IS_VALID_STATE) { programHasChanged(); } } /* This is for debugging of the marking problem after a data update */ else if(program.getProgramState() == Program.WAS_DELETED_STATE) { setForeground(Color.red); mTextColor = Color.red; } else if(program.getProgramState() == Program.WAS_UPDATED_STATE) { setForeground(Color.blue); mTextColor = Color.blue; } boolean dontShow = true; if(mSettings.isShowingPictureForPlugins()) { String[] pluginIds = mSettings.getPluginIds(); Marker[] markers = mProgram.getMarkerArr(); if(markers != null && pluginIds != null) { for (Marker marker : markers) { for (String pluginId : pluginIds) { if(marker.getId().compareTo(pluginId) == 0) { dontShow = false; break; } } } } } // Create the picture area icon if(!mSettings.isShowingOnlyDateAndTitle() && mProgram.getBinaryField(ProgramFieldType.PICTURE_TYPE) != null && ( mSettings.isShowingPictureEver() || !dontShow || (mSettings.isShowingPictureInTimeRange() && !ProgramUtilities.isNotInTimeRange(mSettings.getPictureTimeRangeStart(),mSettings.getPictureTimeRangeEnd(),program)) || (mSettings.isShowingPictureForDuration() && mSettings.getDuration() <= program.getLength()) )) { mPictureAreaIcon = new PictureAreaIcon(program,mNormalFont, WIDTH_RIGHT - 4, mSettings.isShowingPictureDescription(), true, false); } else { mPictureAreaIcon = new PictureAreaIcon(); } // Calculate the maximum description lines int titleHeight = mTitleIcon.getIconHeight(); int maxDescLines = 3; int additionalHeight = Settings.propProgramPanelUsesExtraSpaceForMarkIcons.getBoolean() && program.getMarkerArr().length > 0 ? 16 : 0; if (maxHeight != -1) { maxDescLines = (maxHeight - titleHeight - mPictureAreaIcon.getIconHeight() - additionalHeight - V_GAP) / mNormalFont.getSize(); } if (programChanged || (maxDescLines != mDescriptionIcon.getMaximumLineCount())) { int descHeight = 0; // (Re)set the description text if (!mSettings.isShowingOnlyDateAndTitle()) { mDescriptionIcon.setMaximumLineCount(maxDescLines); ProgramFieldType[] infoFieldArr = Settings.propProgramInfoFields .getProgramFieldTypeArray(); Reader infoReader = new MultipleFieldReader(program, infoFieldArr); try { mDescriptionIcon.setText(infoReader); } catch (IOException exc) { mLog.log(Level.WARNING, "Reading program info failed for " + program, exc); } descHeight = mDescriptionIcon.getIconHeight(); } else { descHeight = 0; } // Calculate the height mHeight = titleHeight + descHeight + mPictureAreaIcon.getIconHeight() + additionalHeight + V_GAP; setPreferredSize(new Dimension(WIDTH, mHeight)); // Calculate the preferred height mPreferredHeight = titleHeight + (maxDescLines * mNormalFont.getSize()) + mPictureAreaIcon.getIconHeight() + additionalHeight + V_GAP; if (mHeight < mPreferredHeight) { mPreferredHeight = mHeight; } } if (isShowing()) { oldProgram.removeChangeListener(this); mProgram.addChangeListener(this); revalidate(); repaint(); } } /** * Gets the plugin icons for a program. * * @param program * The program to get the icons for. * @return The icons for the program. */ private Icon[] getPluginIcons(Program program) { String[] iconPluginArr = Settings.propProgramTableIconPlugins .getStringArray(); if (program.getProgramState() != Program.IS_VALID_STATE || (iconPluginArr == null) || (iconPluginArr.length == 0)) { return new Icon[0]; } else { PluginProxyManager mng = PluginProxyManager.getInstance(); ArrayList<Icon> iconList = new ArrayList<Icon>(); // Add the icons for each plugin for (int pluginIdx = 0; pluginIdx < iconPluginArr.length; pluginIdx++) { if (iconPluginArr[pluginIdx].compareTo(Settings.INFO_ID) == 0) { int info = program.getInfo(); if ((info != -1) && (info != 0)) { for (int i = 0; i < ProgramInfoHelper.mInfoBitArr.length; i++) { if (ProgramInfoHelper.bitSet(info, ProgramInfoHelper.mInfoBitArr[i]) && (ProgramInfoHelper.mInfoIconArr[i] != null)) { // Add the icon to the list iconList.add(ProgramInfoHelper.mInfoIconArr[i]); } } } } else if (iconPluginArr[pluginIdx].compareTo(Settings.PICTURE_ID) == 0) { if(mProgram.getBinaryField(ProgramFieldType.PICTURE_TYPE) != null) { iconList.add(new ImageIcon("imgs/Info_HasPicture.png")); } } else { PluginProxy plugin = mng.getPluginForId(iconPluginArr[pluginIdx]); // Check whether this entry still uses the old class name if (plugin == null) { String asId = "java." + iconPluginArr[pluginIdx]; plugin = mng.getPluginForId(asId); if (plugin != null) { // It was the old class name, not an ID // -> Change the class name to an ID and save it iconPluginArr[pluginIdx] = asId; Settings.propProgramTableIconPlugins .setStringArray(iconPluginArr); } } // Now add the icons if ((plugin != null) && plugin.isActivated()) { Icon[] iconArr = plugin.getProgramTableIcons(program); if (iconArr != null) { // Add the icons for (Icon icon : iconArr) { iconList.add(icon); } } } } } // Convert the list to an array and return it return iconList.toArray(new Icon[iconList.size()]); } } /** * Paints the component. * * @param g * The graphics context to paint to. */ public void paintComponent(Graphics g) { int width = getWidth(); int height = USE_FULL_HEIGHT ? getHeight() : mHeight; Graphics2D grp = (Graphics2D) g; // if program table is anti-aliased, then this program panel too if (Settings.propEnableAntialiasing.getBoolean()) { if (null != grp) { grp.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } } // Draw the background if this program is on air if (mProgram.isOnAir()) { int minutesAfterMidnight = IOUtilities.getMinutesAfterMidnight(); int progLength = mProgram.getLength(); int startTime = mProgram.getStartTime(); int elapsedMinutes; if (minutesAfterMidnight < startTime) { // The next day has begun -> we have to add 24 * 60 minutes // Example: Start time was 23:50 = 1430 minutes after midnight // now it is 0:03 = 3 minutes after midnight // elapsedMinutes = (24 * 60) + 3 - 1430 = 13 minutes elapsedMinutes = (24 * 60) + minutesAfterMidnight - startTime; } else { elapsedMinutes = minutesAfterMidnight - startTime; } if (mAxis == X_AXIS) { int progressX = 0; if (progLength > 0) { progressX = elapsedMinutes * width / progLength; } int pos = Settings.propProgramTableOnAirProgramsShowingBorder.getBoolean() ? 1 : 0; grp.setColor(Settings.propProgramTableColorOnAirDark.getColor()); grp.fillRect(pos, pos, progressX - pos, height - pos); grp.setColor(Settings.propProgramTableColorOnAirLight.getColor()); grp.fillRect(progressX, pos, width - progressX - pos * 2, height - pos); if(Settings.propProgramTableOnAirProgramsShowingBorder.getBoolean()) { grp.draw3DRect(0, 0, width - 1, height - 1, true); } } else { int progressY = 0; if (progLength > 0) { progressY = elapsedMinutes * height / progLength; } int pos = Settings.propProgramTableOnAirProgramsShowingBorder.getBoolean() ? 1 : 0; grp.setColor(Settings.propProgramTableColorOnAirDark.getColor()); grp.fillRect(pos, pos, width - pos * 2, progressY - pos); grp.setColor(Settings.propProgramTableColorOnAirLight.getColor()); grp.fillRect(pos, progressY, width - pos * 2, height - progressY - pos); if(Settings.propProgramTableOnAirProgramsShowingBorder.getBoolean()) { grp.draw3DRect(0, 0, width - 1, height - 1, true); } } } // If there are plugins that have marked the program -> paint the background Marker[] markedByPluginArr = mProgram.getMarkerArr(); if (markedByPluginArr.length != 0) { Color c = Plugin.getPluginManager().getTvBrowserSettings().getColorForMarkingPriority(mProgram.getMarkPriority()); if(c == null) { c = Settings.propProgramPanelMarkedMinPriorityColor.getColor(); } grp.setColor(c); if(mProgram.isExpired()) { grp.setColor(new Color(grp.getColor().getRed(), grp.getColor().getGreen(), grp.getColor().getBlue(), (int)(grp.getColor().getAlpha()*6/10.))); } if(mProgram.getMarkPriority() > Program.NO_MARK_PRIORITY) { if(Settings.propProgramPanelWithMarkingsShowingBoder.getBoolean()) { grp.fill3DRect(0, 0, width, height, true); } else { grp.fillRect(0, 0, width, height); } } } if (mMouseOver || mIsSelected) { Color test = Settings.propMouseOverColor.getColor(); if (mIsSelected) { test = Settings.propKeyboardSelectedColor.getColor(); } grp.setColor(test); grp.fillRect(0, 0, width - 1, height - 1); Stroke str = grp.getStroke(); Color col = grp.getColor(); float dash[] = { 10.0f }; BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f); grp.setColor(Color.BLACK); grp.setStroke(dashed); grp.drawRect(0, 0, width - 1, height - 1); grp.setStroke(str); grp.setColor(col); } // Draw all the text if (mPaintExpiredProgramsPale && mProgram.isExpired()) { setForeground(Color.gray); grp.setColor(Color.gray); } else { setForeground(mTextColor); grp.setColor(mTextColor); } grp.setFont(ProgramPanel.mTimeFont); grp.drawString(mProgramTimeAsString, 1, mTimeFont.getSize()); mTitleIcon.paintIcon(this, grp, WIDTH_LEFT, 0); if (!mSettings.isShowingOnlyDateAndTitle()) { mPictureAreaIcon.paintIcon(this,grp, WIDTH_LEFT, mTitleIcon.getIconHeight()); if (mHeight >= mPreferredHeight) { mDescriptionIcon.paintIcon(this, grp, WIDTH_LEFT, mTitleIcon .getIconHeight() + mPictureAreaIcon.getIconHeight()); } // Paint the icons pale if the program is expired if (mPaintExpiredProgramsPale && mProgram.isExpired()) { grp.setComposite(PALE_COMPOSITE); } } // paint the icons of the plugins that have marked the program int x = width - 1; int y = mTitleIcon.getIconHeight() + mDescriptionIcon.getIconHeight() + mPictureAreaIcon.getIconHeight() + 18; y = Math.min(y, height - 1); for (Marker marker: markedByPluginArr) { Icon[] icons = marker.getMarkIcons(mProgram); if (icons != null) { for(int i = icons.length - 1; i >= 0 ; i--) { x -= icons[i].getIconWidth(); icons[i].paintIcon(this, grp, x, y - icons[i].getIconHeight()); } } } // Paint the icons on the left side if (mIconArr != null) { x = 2; y = mTimeFont.getSize() + 3; // calculate height with double column layout int sumHeights = -2; int maxWidth = 0; int rowWidth = 0; for (int i = 0; i < mIconArr.length; i++) { sumHeights += mIconArr[i].getIconHeight() + 2; if (i % 2 == 0) { rowWidth = mIconArr[i].getIconWidth(); } else { rowWidth += mIconArr[i].getIconWidth(); } if (rowWidth > maxWidth) { maxWidth = rowWidth; } } // single column of icons int colCount = 1; // layout icons in pairs if ((y + sumHeights >= mHeight) && (maxWidth < WIDTH_LEFT)) { colCount = 2; } int iconHeight = 0; int currentX = x; for (int i = 0; i < mIconArr.length; i++) { Icon icon = mIconArr[i]; boolean nextColumn = (colCount == 1) || (i % 2 == 0); if (nextColumn) { currentX = x; iconHeight = icon.getIconHeight(); } else { iconHeight = Math.max(iconHeight, icon.getIconHeight()); } if ((y + iconHeight) < mHeight) { icon.paintIcon(this, grp, currentX, y); } if (nextColumn) { currentX += icon.getIconWidth() + 2; } if (!nextColumn || (colCount == 1)) { y += iconHeight + 2; } } } // Reset the old composite if (mPaintExpiredProgramsPale && mProgram.isExpired()) { grp.setComposite(NORMAL_COMPOSITE); } } /** * Called when the panel is added to a container. * <p> * registers the panel as ChangeListener at the program. */ public void addNotify() { super.addNotify(); mProgram.addChangeListener(this); PluginProxyManager.getInstance().addPluginStateListener(this); } /** * Called when the panel is added to a container. * <p> * removes the panel as ChangeListener from the program. */ public void removeNotify() { super.removeNotify(); mProgram.removeChangeListener(this); PluginProxyManager.getInstance().removePluginStateListener(this); } /** * Gets the program object of this ProgramPanel. * * @return the program object of this ProgramPanel. */ public Program getProgram() { return mProgram; } /** * Adds a MouseListener that shows the plugin context menu when the user does * a right click on the program panel. * * @param caller * The ContextMenuIf to exclude from the context menu. When * <code>null</code> no ContextMenuIf is excluded. */ public void addPluginContextMenuMouseListener(final ContextMenuIf caller) { addMouseListener(new MouseAdapter() { private Thread mLeftClickThread; public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { showPopup(e, caller); } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { showPopup(e, caller); } } public void mouseClicked(final MouseEvent evt) { if (SwingUtilities.isLeftMouseButton(evt) && (evt.getClickCount() == 1) && evt.getModifiersEx() == 0) { mLeftClickThread = new Thread() { public void run() { try { sleep(Plugin.SINGLE_CLICK_WAITING_TIME); Plugin.getPluginManager().handleProgramSingleClick(mProgram, caller); } catch (InterruptedException e) { // ignore } } }; mLeftClickThread.setPriority(Thread.MIN_PRIORITY); mLeftClickThread.start(); } else if (SwingUtilities.isLeftMouseButton(evt) && (evt.getClickCount() == 2) && evt.getModifiersEx() == 0) { if(mLeftClickThread != null && mLeftClickThread.isAlive()) { mLeftClickThread.interrupt(); } Plugin.getPluginManager().handleProgramDoubleClick(mProgram, caller); } else if (SwingUtilities.isMiddleMouseButton(evt) && (evt.getClickCount() == 1)) { Plugin.getPluginManager().handleProgramMiddleClick(mProgram, caller); } } }); } /** * Shows the Popup * * @param evt * Event for X/Y-Coordinates * @param caller * ContextMenuIf that called this */ private void showPopup(MouseEvent evt, ContextMenuIf caller) { if (SwingUtilities.isRightMouseButton(evt)) { JPopupMenu menu = PluginProxyManager.createPluginContextMenu(mProgram, caller); menu.show(evt.getComponent(), evt.getX() - 15, evt.getY() - 15); } } /** * Should be called, when the program has changed. * <p> * If you use this program panel directly (this is the case, when you have * added it into a JPanel), you don't have to call this method. This is done * automatically. * <p> * But if you use this panel just as renderer (e.g. for a list) you have to * register at the programs as ChangeListener and call this method when * {@link ChangeListener#stateChanged(javax.swing.event.ChangeEvent)} was * called. * * @see Program#addChangeListener(ChangeListener) */ public void programHasChanged() { // Get the icons from the plugins mIconArr = getPluginIcons(mProgram); } // implements ChangeListener /** * Called when the state of the program has changed. * <p> * repaints the panel. * * @param evt * The event describing the change. */ public void stateChanged(ChangeEvent evt) { if (evt.getSource() == mProgram) { programHasChanged(); repaint(); } } /** * Sets the Color of the Text * * @param col * Color of the Text */ public void setTextColor(Color col) { mTextColor = col; } /** * Returns the Color of the Text * * @return Color of the Text */ public Color getTextColor() { return mTextColor; } /** * Paints the ProgramPanel * * @param mouse * under a Mouse and needs highlight? * @param isSelected * IsSelected program? * @param g * Graphics-Object * */ public void paint(boolean mouse, boolean isSelected, Graphics g) { mMouseOver = mouse; mIsSelected = isSelected; super.paint(g); } /** * @return The smallest height possible. */ public int getMinimumHeight() { return mTitleIcon.getIconHeight() + mPictureAreaIcon.getIconHeight() + 3 + (Settings.propProgramPanelUsesExtraSpaceForMarkIcons.getBoolean() && mProgram.getMarkerArr().length > 0 ? 16 : 0); } /** * Sets if expired programs should be painted pale. * <p> * @param value <code>True</code> if expired programs should be painted pale, * <code>false</code> otherwise. * @since 2.7 */ public void setPaintExpiredProgramsPale(boolean value) { mPaintExpiredProgramsPale = value; } public void pluginActivated(PluginProxy plugin) { if (plugin.getProgramTableIcons(Plugin.getPluginManager().getExampleProgram()) != null) { updatePrograms(); } } public void pluginDeactivated(PluginProxy plugin) { updatePrograms(); } private void updatePrograms() { programHasChanged(); repaint(); } public void pluginLoaded(PluginProxy plugin) { // noop } public void pluginUnloaded(PluginProxy plugin) { // noop } /* Deprecated constructors from here */ /** * Creates a new instance of ProgramPanel. * * @param showOnlyDateAndTitle * If this panel should only show date time and title. * @since 2.2.1 * @deprecated Since 2.2.2 Use {@link #ProgramPanel(ProgramPanelSettings)} instead. */ public ProgramPanel(boolean showOnlyDateAndTitle) { this(new ProgramPanelSettings(Settings.propPictureType.getInt(), Settings.propPictureStartTime.getInt(), Settings.propPictureEndTime.getInt(), showOnlyDateAndTitle, Settings.propIsPictureShowingDescription.getBoolean(), Settings.propPictureDuration.getInt(), Settings.propPicturePluginIds.getStringArray())); } /** * Creates a new instance of ProgramPanel. * * @param prog * The program to show in this panel. * @param axis * Orientation of ProgressBar (X_AXIS/Y_AXIS) * @deprecated Since 2.7 Use {@link #ProgramPanel(Program, ProgramPanelSettings)} instead. */ public ProgramPanel(Program prog, int axis) { this(); mAxis = axis; setProgram(prog); } /** * Creates a new instance of ProgramPanel. * * @param prog * The program to show in this panel. * @param showOnlyDateAndTitle * If this panel should only show date time and title. * * @since 2.2.1 * @deprecated Since 2.2.2 Use {@link #ProgramPanel(Program, ProgramPanelSettings)} instead. */ public ProgramPanel(Program prog, boolean showOnlyDateAndTitle) { this(showOnlyDateAndTitle); setProgram(prog); } /** * Creates a new instance of ProgramPanel. * * @param prog * The program to show in this panel. * @param axis * Orientation of ProgressBar (X_AXIS/Y_AXIS) * @param showOnlyDateAndTitle * If this panel should only show date time and title. * * @since 2.2.1 * @deprecated Since 2.2.2 Use {@link #ProgramPanel(Program, int, ProgramPanelSettings)} instead. */ public ProgramPanel(Program prog, int axis, boolean showOnlyDateAndTitle) { this(showOnlyDateAndTitle); mAxis = axis; setProgram(prog); } /** * Creates a new instance of ProgramPanel. * * @param settings The settings for this program panel. * @param axis The axis of the progress bar. * @deprecated Since 2.7 Use {@link #ProgramPanel(ProgramPanelSettings)} instead. */ public ProgramPanel(ProgramPanelSettings settings, int axis) { this(settings); mAxis = axis; } }

The table below shows all metrics for ProgramPanel.java.

MetricValueDescription
BLOCKS147.00Number of blocks
BLOCK_COMMENT27.00Number of block comment lines
COMMENTS334.00Comment lines
COMMENT_DENSITY 0.68Comment density
COMPARISONS131.00Number of comparison operators
CYCLOMATIC159.00Cyclomatic complexity
DECL_COMMENTS60.00Comments in declarations
DOC_COMMENT270.00Number of javadoc comment lines
ELOC492.00Effective lines of code
EXEC_COMMENTS33.00Comments in executable code
EXITS135.00Procedure exits
FUNCTIONS47.00Number of function declarations
HALSTEAD_DIFFICULTY95.59Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY93.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 1.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 1.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 0.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 0.00JAVA0034 Missing braces in if statement
JAVA0035 0.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 4.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA0064 1.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 1.00JAVA0067 Array descriptor on identifier name
JAVA0068 2.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 8.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 1.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 1.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 0.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 1.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 1.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116 0.00JAVA0116 Missing javadoc: field 'field'
JAVA0117 2.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 0.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 1.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 0.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 8.00JAVA0144 Line exceeds maximum M characters
JAVA0145 0.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 0.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 1.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 1.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 0.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA028533.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES1086.00Number of lines in the source file
LINE_COMMENT37.00Number of line comments
LOC627.00Lines of code
LOGICAL_LINES331.00Number of statements
LOOPS 5.00Number of loops
NEST_DEPTH 7.00Maximum nesting depth
OPERANDS1567.00Number of operands
OPERATORS2984.00Number of operators
PARAMS44.00Number of formal parameter declarations
PROGRAM_LENGTH4551.00Halstead program length
PROGRAM_VOCAB515.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS49.00Number of return points from functions
SIZE34460.00Size of the file in bytes
UNIQUE_OPERANDS459.00Number of unique operands
UNIQUE_OPERATORS56.00Number of unique operators
WHITESPACE125.00Number of whitespace lines